PC Review


Reply
Thread Tools Rate Thread

activesheet.name ending in "-" &Style1

 
 
Wally
Guest
Posts: n/a
 
      12th Oct 2010
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

 
Reply With Quote
 
 
 
 
Don Guillett Excel MVP
Guest
Posts: n/a
 
      12th Oct 2010
On Oct 12, 3:49*pm, Wally <gerrywald...@gmail.com> 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
 
Reply With Quote
 
Wally
Guest
Posts: n/a
 
      25th Oct 2010
On Oct 12, 5:13*pm, Don Guillett Excel MVP <dguille...@austin.rr.com>
wrote:
> On Oct 12, 3:49*pm, Wally <gerrywald...@gmail.com> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveSheet.Shapes("Rectangle 23").Select will not work in 2007 nkat Microsoft Excel Programming 3 12th Nov 2008 05:56 PM
Change "With Worksheets" to "Activesheet" J.W. Aldridge Microsoft Excel Programming 2 23rd Jul 2008 09:13 PM
What are the reasons for ""ActiveSheet.Paste Link:=True"" failure CAPTGNVR Microsoft Excel Programming 9 7th Jul 2007 09:56 PM
Print Outlook Calendar without "Ending Times" - only "Start Times" =?Utf-8?B?SmltbXk=?= Microsoft Outlook Calendar 0 9th Feb 2006 05:58 PM
Mail from "safe senders" is ending up in the "junk email" folder malcolmdickinson@gmail.com Microsoft Outlook Discussion 2 6th Dec 2005 04:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:58 PM.