Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping Thru Worksheets
I have a chunk of code that I would like to run thru on only certain
worksheets. How do I loop thru say only Sheets 2-6? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping Thru Worksheets
Worksheets are numbered from left to right regardless of their names.
Method One: for i = 2 to 6 sheets(i).select <Your Code next i Method Two (preferred due to unknowns such as hidden sheets): for i = 2 to 6 sheets("Sheet" & i).select <Your Code next i HTH, Paul "Jay" wrote in message ... I have a chunk of code that I would like to run thru on only certain worksheets. How do I loop thru say only Sheets 2-6? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping Thru Worksheets
For Each Sh In
Worksheets(Array("Sheet2","Sheet3","Sheet4","Sheet 5","Sheet6")) 'do something Next sh -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Jay" wrote in message ... I have a chunk of code that I would like to run thru on only certain worksheets. How do I loop thru say only Sheets 2-6? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Worksheets looping. | Excel Programming | |||
Looping through Worksheets | Excel Programming | |||
Looping through Worksheets | Excel Programming | |||
looping through worksheets | Excel Programming | |||
looping through worksheets | Excel Programming |