Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Criteria based sheet selection array...

Status
Not open for further replies.

tweek312

Technical User
Dec 18, 2004
148
US
Based on: thread68-483892

I need this code to select as an array. Currently it is selecting the first and last sheet with "!*".

Ive tried fudging with it but I cant find anything that works for me.

Thanks,
tw33k

Code:
For Each ws In Worksheets
    If ws.Name Like "!*" Then ws.Select
Next ws
 
You may try this:
s = ""
For Each ws In Worksheets
If ws.Name Like "!*" Then s = s & Chr(1) & ws.Name
Next ws
Sheets(Split(Mid(s, 2), Chr(1))).Select

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top