Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default If Sheet Name, No Action

Is there an easier way to do this:
If (sh.Name) < "SH1 - Ryan" Then
If (sh.Name) < "SH1 - Jimmy" Then
If (sh.Name) < "SH1 - Tim" Then
If (sh.Name) < "SH1 - Todd" Then
If (sh.Name) < "SH1 - Frank" Then
If (sh.Name) < "SH1 - Susie" Then


Something like this:
If (sh.Name) < "SH1 - *" Then

(but this does not work€¦)

Regards,
Ryan---

--
RyGuy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default If Sheet Name, No Action

You could use a select case statement something like this...

select case sh.name
case "SH1 - Ryan", "SH1 - Jimmy", "SH1 - Tim", "SH1 - Todd", _
"SH1 - Frank", "SH1 - Susie"
case else
'Now do yoru stuff
end select

--
HTH...

Jim Thomlinson


"ryguy7272" wrote:

Is there an easier way to do this:
If (sh.Name) < "SH1 - Ryan" Then
If (sh.Name) < "SH1 - Jimmy" Then
If (sh.Name) < "SH1 - Tim" Then
If (sh.Name) < "SH1 - Todd" Then
If (sh.Name) < "SH1 - Frank" Then
If (sh.Name) < "SH1 - Susie" Then


Something like this:
If (sh.Name) < "SH1 - *" Then

(but this does not work€¦)

Regards,
Ryan---

--
RyGuy

  #3   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default If Sheet Name, No Action

Ryan

Try the Like operator; maybe something like:

Sub test3()

For Each sh In Sheets

If sh.Name Like "Sh*" Then MsgBox sh.Name

Next sh

End Sub


Good luck.

Ken
Norfolk, Va


On Jun 12, 3:49*pm, ryguy7272
wrote:
Is there an easier way to do this:
If (sh.Name) < "SH1 - Ryan" Then
If (sh.Name) < "SH1 - Jimmy" Then
If (sh.Name) < "SH1 - Tim" Then
If (sh.Name) < "SH1 - Todd" Then
If (sh.Name) < "SH1 - Frank" Then
If (sh.Name) < "SH1 - Susie" Then

Something like this:
If (sh.Name) < "SH1 - *" Then

(but this does not work…)

Regards,
Ryan---

--
RyGuy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default If Sheet Name, No Action

Thanks a ton! Works great!!
Regards,
Ryan---

--
RyGuy


"Ken" wrote:

Ryan

Try the Like operator; maybe something like:

Sub test3()

For Each sh In Sheets

If sh.Name Like "Sh*" Then MsgBox sh.Name

Next sh

End Sub


Good luck.

Ken
Norfolk, Va


On Jun 12, 3:49 pm, ryguy7272
wrote:
Is there an easier way to do this:
If (sh.Name) < "SH1 - Ryan" Then
If (sh.Name) < "SH1 - Jimmy" Then
If (sh.Name) < "SH1 - Tim" Then
If (sh.Name) < "SH1 - Todd" Then
If (sh.Name) < "SH1 - Frank" Then
If (sh.Name) < "SH1 - Susie" Then

Something like this:
If (sh.Name) < "SH1 - *" Then

(but this does not work€¦)

Regards,
Ryan---

--
RyGuy



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
Excell copy action pauses for 15 second for the smallest action Meekal Excel Discussion (Misc queries) 1 January 28th 10 04:30 PM
Copy Sheet action very slow RobN[_3_] Excel Discussion (Misc queries) 0 June 27th 07 03:32 AM
Action on sheet Selection jpizzle[_8_] Excel Programming 4 June 13th 05 05:33 PM
Action on sheet Selection Piranha[_9_] Excel Programming 0 June 7th 05 08:59 AM
How to action on Open Sheet Jan Nademlejnsky Excel Programming 1 December 8th 04 06:03 AM


All times are GMT +1. The time now is 10:23 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"