JustPlainD
New Member
- Joined
- Sep 1, 2017
- Messages
- 3
Hello,
I am trying to use loop for the first time. I need to loop through open workbooks, and close each workbook after I have copied the data from it. I am trying the following the below to indicate the next workbook, but it always treats the value as true even if there is only the workbook with the macros open.
If ActiveWindow.ActivateNext = False Then
GoTo DDC
ElseIf ActiveWindow.ActivateNext = True Then
GoTo DDC
End If
DC:
code here
DDC:
code to finalize.
I also tried
Do until ActiveWindow.ActivateNext = False
code
Loop
No luck there either.
Any help would be greatly appreciated.
JustPlainD
I am trying to use loop for the first time. I need to loop through open workbooks, and close each workbook after I have copied the data from it. I am trying the following the below to indicate the next workbook, but it always treats the value as true even if there is only the workbook with the macros open.
If ActiveWindow.ActivateNext = False Then
GoTo DDC
ElseIf ActiveWindow.ActivateNext = True Then
GoTo DDC
End If
DC:
code here
DDC:
code to finalize.
I also tried
Do until ActiveWindow.ActivateNext = False
code
Loop
No luck there either.
Any help would be greatly appreciated.
JustPlainD