Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe, maybe not.
If you change your CodeNames so that they end in 01, 02, ... 10 you might be able to do what you want in one loop. For each wks in Worksheets strTail = Right(wks.Codename, 2) If IsNumeric(strTail) then Select Case Int(strTail) Case 1 to 10 'Do something to this wks that ends in a number between 01 & 10 Case Else 'Do nothing to this wks that ends in a number 10 EndSelect Else 'Do nothing to this wks that doesn't end in a number. End if Next wks The trick may be to adopt a naming convention that allows you to handle CodeNames efficiently in a loop like this. -- George Nicholson Remove 'Junk' from return address. "Ricky M. Medley" wrote in message ... yeah....your last suggestion sounds like a viable one. {go through each one until if finds the right one}, but my code is so long already, and is starting to take time to execute...my goal is to keep every execution under 500 miliseconds. This would take two loops...one to go through 1-10, and one to go through each worksheet. Thanks though...I will try to see if time is under limits. ricky "George Nicholson" wrote in message ... <<snip Because of this, the specific loop you envision may not be possible. However, you could do a For..Each loop on the Worksheets collection and then do a SelectCase on the CodeName within that loop. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
object variable or with block variable not set | Excel Discussion (Misc queries) | |||
Error 91 - Object variable with block variable not set | Excel Programming | |||
Object Variable or With Block variable not set? | Excel Programming |