VBA Macro
12.10.2005 07:42:55
Michael
Der Code für eine Datei:
Sub BlaetterSpeichern(Pfad As String, Dateiname As String)
Dim ws As Worksheet, wb As Workbook
If Right(Pfad, 1) <> "\" Then Pfad = Pfad & "\"
Set wb = Workbooks.Open(Pfad & Dateiname)
For Each ws In wb.Worksheets
ws.Copy
With ActiveWorkbook
.SaveAs Filename:=Pfad & Replace(Dateiname, ".xls", "") & "_" & ws.Name
.Close
End With
Next ws
wb.Close False
End Sub
Sub Aufruf()
BlaetterSpeichern ThisWorkbook.Path, "d1.xls"
End Sub