Good code mancubus!
Beatrix, sorry for the errors but I tested here by creating a folder with dummy files with extension ".xlsx" inside, and no errors happened. In wich line the error 1004 occurs?
During testing, I found an error in the code:
[VBA] '***For Each Workbook and for its Worksheets, delete rows***'
For Each Entry In WorkArea
Workbooks.Open Filename:=TargetPath & "\" & Entry.Value
Workbooks(Entry.Value).Activate
Caption = MsgBox("Is first row of the range is same in each tab?", vbYesNo, "Beatrix Automation")
If Caption = vbYes Then
Set Range_Selection = Application.InputBox("Select the first row", "Get Range", Type:=8)
For Each Sheet In ActiveWorkbook.Worksheets
Set WorkArea2 = ActiveSheet.Range(Cells(Range_Selection.Row, 1), Cells(Cells(Rows.Count, 1).End(xlUp).Row, 1))
For Each Entry2 In WorkArea2
If Entry2.Value = "" Then
Entry.EntireRow.Delete[/VBA]
The last line should be Entry2.EntireRow.Delete
Same to this:
[VBA]ElseIf Caption = vbNo Then For Each Sheet In ActiveWorkbook.Worksheets
Set Range_Selection = Application.InputBox("Select the first row", "Get Range", Type:=8)
Set WorkArea2 = ActiveSheet.Range(Cells(Range_Selection.Row, 1), Cells(Cells(Rows.Count, 1).End(xlUp).Row, 1))
For Each Entry2 In WorkArea2
If Entry2.Value = "" Then
Entry.EntireRow.Delete[/VBA]