Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default activesheet.name ending in "-" &Style1

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default activesheet.name ending in "-" &Style1

On Oct 12, 5:13*pm, Don Guillett Excel MVP
wrote:
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


Thanks Don

That worked for most but I have one Style that is only N, so when I
have it look for -N it also finds -NSH, -N72, etc.

Can I have it find the pages ending in -N?

Thanks

Gerry
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - How do I keep an ending space in a cell? i.e. "Mr. " jme123 Excel Discussion (Misc queries) 1 April 7th 09 03:02 AM
ActiveSheet.Shapes("Rectangle 23").Select will not work in 2007 nkat Excel Programming 3 November 12th 08 05:56 PM
Change "With Worksheets" to "Activesheet" J.W. Aldridge Excel Programming 2 July 23rd 08 09:13 PM
How do I keep a 17 digit number from ending in "0" in excel? creel28270 Excel Discussion (Misc queries) 6 June 18th 08 04:12 PM
What are the reasons for ""ActiveSheet.Paste Link:=True"" failure CAPTGNVR Excel Programming 9 July 7th 07 09:56 PM


All times are GMT +1. The time now is 01:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"