Cycle through all worksheets?


Posted by Christopher Patrick on February 06, 2002 8:32 AM

Hi all-

Does anyone know of a way to cycle through all available worksheets in a workbook? Basically, I have a workbook with multiple sheets of different sheet names. I want to setup a for loop, and perform an action on each page, but I am not quite sure if there is a foreach worksheet command or similar?

Thanks in advance for any help.

chris

Posted by Mudface on February 06, 2002 8:40 AM

There is indeed-

Dim ws as Worksheet

For Each ws In Worksheets

' Your code

Next ws



Posted by Christopher Patrick on February 06, 2002 8:42 AM

Awesome..thanks so much