Thread
:
Loop through specific worksheets
View Single Post
#
3
Posted to microsoft.public.excel.programming
Don Guillett[_4_]
external usenet poster
Posts: 2,337
Loop through specific worksheets
does this idea help? You do not usually have to specify the sheet name
unless you have duplicate names.
Sub loopthrusheetarray()
Dim Sh As Worksheet
For Each Sh In Sheets(Array("Sheet2", "Sheet6", "Sheet10"))
MsgBox Sh.Range("a1")
Next
End Sub
--
Don Guillett
SalesAid Software
"Ben" wrote in message
...
I am familiar with the code to loop through all the worksheets in a
workbook
with a "For Each ws in Worksheets" construct but I would like a routine to
be
confined to a selection of named worksheets within a workbook. Let's say
the
worksheet names are in a range called "MyList" in a worksheet called
"Control". What code should I use to apply my routine only to the
worksheets
in "Mylist".
Thank you.
Reply With Quote
Don Guillett[_4_]
View Public Profile
Find all posts by Don Guillett[_4_]