User:Hedwig in Washington/XLS2JPG
From Wikimedia Commons, the free media repository
Contents |
[edit] Excel-Tools
[edit] de: Excel-Diagramm als JPG speichern
Hier ein kleines Makro um das derzeit aktive Excel-Diagramm als JPG zu speichern. Der Pfad (C:\Temp) kann angepasst werden.
- mit ALT-F11 den VBA-Editor öffnen
- das oben links erscheint ein kleines Fenster Projekt-VBA-Projekt
- Rechtsklick auf VBA-Projekt(Name der Datei)
- Einfügen wählen, Modul wählen
- Makro weiter von hier unten markieren und in das neu geöffnete Fenster kopieren
- zurück zum Diagramm, ALT-F8 drücken, Fenster Makros wird geöffnet
- das neu erstellte Makro auswählen und starten
- Dateinamen angeben
- FERTIG
Quelle: Irgendein Internetforum mit Excel-Schwerpunkt. Dieses Makro habe ich schon so lange, daß ich nicht mehr genau sagen kann, wo es herkommt.
ICH ÜBERNEHME KEINE HAFTUNG FÜR DATENVERLUST ODER ÄHNLICHES!
DAS MAKRO FUNKTIONIERT BEI MIR EINWANDFREI, VORHER IMMER EIN BACKUP MACHEN!
[edit] en: Save Excel-Chart as JPG
Here is a little macro for you to save the active Excel-Chart as a JPG-picture. You can rename the default folder (C:\temp) if you like.
- pressing ALT-F11 opens the vba-editor
- there will be a little window named Project-VBAProject
- rightclick on VBA-Project (the name of your xls-file)
- choose insert and module
- copy the macro from here below
- paste the macro into the window named your filename -moduleX (Code)
- go back to your chart, press ALT-F8, the window macros will be opened
- choose the new macro (DiagrammAlsJPGSpeichern) and click on run
- enter a name for the picture
- you're done!
Source: Got it from some Excel-Forum. I can't tell you where or when.
Disclaimer: USE ON YOUR OWN RISK!!! I RECOMMEND TO RUN A BACKUP BEFORE USING!
'I'M NOT RESPONSIBLE FOR ANY DATALOSS OR WHATEVER!THE MACRO WORKS FINE FOR ME!
[edit] Zum ausschnippeln / cut out:
Sub DiagrammAlsJPGSpeichern()
Dim GDiagramm As Chart
Dim NameT As String
Const PfadDiagramm = "C:\temp\"
Set GDiagramm = ActiveChart
NameT = InputBox("Name der Datei:", "Export Chart", ActiveChart.Name)
If NameT <> "" Then
GDiagramm.Export Filename:=PfadDiagramm & NameT & ".JPG", FilterName:="JPG"
End If
End Sub