Option
Explicit
Sub
Zeilen_Löschen()
Dim
wkb
As
Excel.Workbook
Dim
cDir
As
String
Dim
sPath
As
String
Dim
i
As
Long
sPath =
"hier steht der Pfad wo Die Dateien abliegen"
cDir = Dir(sPath &
"*.xls"
)
Application.ScreenUpdating =
False
Application.DisplayAlerts =
False
Do
While
cDir <>
""
Set
wkb = Application.Workbooks.Open(sPath & cDir)
With
wkb
.Worksheets(
"Dropdowns"
).Visible =
True
.Worksheets(
"Dropdowns"
).Rows(5).Delete
.Worksheets(
"Dropdowns"
).Rows(5).Delete
.Worksheets(
"Dropdowns"
).Visible =
False
For
i = 2
To
.Worksheets.Count - 1
.Worksheets(i).Range(
"U4:AC4"
).Cut Destination:=.Worksheets(i).Range(
"Q4"
)
.Worksheets(i).Range(
"Z4:AC4"
).Clear
Next
.Close
False
End
With
cDir = Dir
Loop
MsgBox
"Zeilen gelöscht!"
Application.ScreenUpdating =
True
Application.DisplayAlerts =
True
End
Sub