Ich bin auf der Suche nach einer Möglichkeit via Button zwei Worksheets in ein bestimmtes Verzeichnis zu speichern und zwar einmal als *.xlsx und einmal als *.pdf.
Geht so was und wie muss ich da vorgehen?
Vielen Dank
Sub Makro2()
' aufgezeichnet von Bernd Kiehl
Sheets("Tabelle1").Select
Sheets("Tabelle1").Copy
ActiveWorkbook.SaveAs Filename:="E:\MS-Excel\Mappe2.xlsx", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"E:\MS-Excel\Mappe2.pdf", Quality:=xlQualityStandard, IncludeDocProperties _
:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
ActiveWorkbook.Close
End Sub
Gruß BerndSub Makro2()
Dim Pfad As String, DName As String
Pfad = "E:\MS-Excel\"
DName = "Test"
With Sheets("Tabelle1")
.Copy
ActiveWorkbook.SaveAs Filename:=Pfad & DName & ".xlsx", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Pfad & DName & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
ActiveWorkbook.Close
End With
End Sub