C
Chris Watts
I have three workbooks open and wish to limit the scope of operation to all
the sheets in one workbook.
Is there a construct something like:
Dim WS As Worksheet
For Each WS in Workbook("Workbook name") ' or in ActiveWorkbook
' Do something
Next WS
I cannot find anything just WS in Worksheets which is too broad.
I guess though I could do something like:
For Each WS in Worksheets
If (WS.Parent.Name<>ActiveWorkbook.Name) Then Go To NextWS
'Do something
NextWS:
Next WS
I am using VBA in Excel 2007
TIA
Chris
the sheets in one workbook.
Is there a construct something like:
Dim WS As Worksheet
For Each WS in Workbook("Workbook name") ' or in ActiveWorkbook
' Do something
Next WS
I cannot find anything just WS in Worksheets which is too broad.
I guess though I could do something like:
For Each WS in Worksheets
If (WS.Parent.Name<>ActiveWorkbook.Name) Then Go To NextWS
'Do something
NextWS:
Next WS
I am using VBA in Excel 2007
TIA
Chris