View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Excel MVP Don Guillett Excel MVP is offline
external usenet poster
 
Posts: 168
Default activesheet.name ending in "-" &Style1

On Oct 12, 3:49*pm, Wally wrote:
I'm trying to find all sheets that end in "-" & Style1

If ActiveSheet.Name Like "??-" & Style1 Then
If ActiveSheet.Name Like "???-" & Style1 Then
If ActiveSheet.Name Like "????-" & Style1 Then

The sheetname could begin with 2 to 4 letters and always ends in - and
Style1 (another series of characters)
Style1 is 1-3 characters long.

TIA
Gerry


Sub findsheet()
For i = 1 To Sheets.Count
If InStr(LCase(Sheets(i).Name), "style") Then MsgBox i
Next i
End Sub