Do ohne Loop
06.05.2013 15:14:13
Sascha
ich bekomme beim folgenden Code die Fehlermeldung: Do ohne Loop!
Sieht jemand woran es liegen könnte?
Sub copy_prod()
Dim Datei As String
Dim Pfad As String
Pfad = "S:\Pulverstatus\export-prod\"
Datei = Dir(Pfad & "*.xls*")
Do While Datei ""
Workbooks.Open Pfad & Datei
ActiveWorkbook.Sheets("uebertragung2").UsedRange.Copy
With ThisWorkbook.Sheets("prod")
.Cells(.Cells.SpecialCells(xlCellTypeLastCell).Row + 1, 1).PasteSpecial Paste:=xlPasteAll
End With
ActiveWorkbook.Close
Kill Pfad & Datei
Datei = Dir
End Sub
Vorab vielen Dank.
LG
Sascha