The folowing code is part of a code that opens the file listed in cell A1 to run a Macro to apply appropriate format and once completed the value in cell A1 is deleted in order to run the macro in the new file listed in Cell A1 that was before in Cell A2.
Why doesn't the code below do the loop?
Do
Range("A1").Select
If IsEmpty(ActiveCell) Then
MsgBox ("completed")
Exit Sub
Else
Workbooks.Open FileName:=(Range("E3") & Range("F3") & Range("A1"))
Call macro_name
Range("A1").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
End If
MsgBox ("completed")
Range("A1").Select
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
Why doesn't the code below do the loop?
Do
Range("A1").Select
If IsEmpty(ActiveCell) Then
MsgBox ("completed")
Exit Sub
Else
Workbooks.Open FileName:=(Range("E3") & Range("F3") & Range("A1"))
Call macro_name
Range("A1").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
End If
MsgBox ("completed")
Range("A1").Select
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, 1))