alle arbeitsblätter als neue datei
25.09.2008 19:25:00
Bastian
ich habe folgendes Makro (von Euch bekommen :-) )das ein Tabellenblatt (values) als neue Datei abspeichert.
Wie würde das Makro aussehen, damit das für alle Arbeitsblätter einer Date geschieht, und nicht nur für das eine.?
Danke und Gruss
Bastian
Sub copyandsave()
Dim Dateiname As String
Dateiname = "R:\test\PC_" & " " & Range("O3").Value & " " & Format(Now(), "DD.MM.YY HH.MM") & " _
_prices_.xls"
ThisWorkbook.Sheets("Values").Copy
Dim i As Long, laR As Long
Application.ScreenUpdating = False
laR = Cells(Rows.Count, 1).End(xlUp).Row
For i = laR To 1 Step -1
If Cells(i, 1).Value = "" Then
Cells(i, 1).EntireRow.delete
End If
Next i
Application.ScreenUpdating = True
ActiveWorkbook.SaveAs Dateiname, FileFormat:=xlExcel8
ActiveWorkbook.Close
End Sub