Loop Thru Worksheets

T

Tinkerbell

Hello
I have a workbook with several worksheets that contain the same rows
and same colums that I run a macro on each sheet one sheet at a time
the macro does the same thing to each sheet It works just fine .
All I need is to have the Macro run on every sheet in the workBook I
know it can be done but I cant get anything to work for Me.
Can anyone Help me with something I can use to loop thru the
worksheets?
Thanks
OKE DOKE
 
D

Doug Glancy

Tinkerbell,

Sub test()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
' your code here
Next ws
End Sub

hth,

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top