Allen Prince
asked on
Check Excel worksheet tab name for text and hide the sheet
I want to check if a workbook contains a tab with the name work* IE: workarea or "work sheet"
and hide the sheets that are so named
and hide the sheets that are so named
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I can't see why having more than one sheet with the name beginning with 'work' would cause an error but what error is it causing?
As for the case thing, try this.
As for the case thing, try this.
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
If LCase(ws.Name) LIke "work*" Then
ws.Visible = False
End If
Next ws
ASKER
You are correct on both counts!
I must have mistyped something .
LCase works fine
Thanks
I must have mistyped something .
LCase works fine
Thanks
ASKER
except...
it is case sensitive!
and...
if for some reason there are two sheets that have a tab name begining with "work" there is an error..
how to pose this question?
hmm...