User:Hedwig in Washington/XLS2JPG

From Wikimedia Commons, the free media repository

Jump to: navigation, search

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.

  1. mit ALT-F11 den VBA-Editor öffnen
  2. das oben links erscheint ein kleines Fenster Projekt-VBA-Projekt
  3. Rechtsklick auf VBA-Projekt(Name der Datei)
  4. Einfügen wählen, Modul wählen
  5. Makro weiter von hier unten markieren und in das neu geöffnete Fenster kopieren
  6. zurück zum Diagramm, ALT-F8 drücken, Fenster Makros wird geöffnet
  7. das neu erstellte Makro auswählen und starten
  8. Dateinamen angeben
  9. 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.

  1. pressing ALT-F11 opens the vba-editor
  2. there will be a little window named Project-VBAProject
  3. rightclick on VBA-Project (the name of your xls-file)
  4. choose insert and module
  5. copy the macro from here below
  6. paste the macro into the window named your filename -moduleX (Code)
  7. go back to your chart, press ALT-F8, the window macros will be opened
  8. choose the new macro (DiagrammAlsJPGSpeichern) and click on run
  9. enter a name for the picture
  10. 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