Loop through sheets

M

michael

I know there must be a solution to tihs, but I don't know
how. I need to go through each sheet in a workbook (could
be any number of sheets) and change the formula's to
values. I can do the formula to values bit but can' get
it to loop through all the sheets to the end.

TIA

Michael
 
B

Bob Umlas

For i=1 to Sheets.Count
Set TheSheet = Sheets(i)
...
Next

Bob Umlas
Excel MVP
I am leading a free 1-hour seminar on the web on Excel tips & tricks.
Tuesday, 9/21, from 3-4PM est.

This is the 2nd one -- the first one filled up (100 people) & is closed.

To sign up, go to http://www.iil.com, click on the orange box on the left
side saying "try a free webinar",
then click "Microsoft Excel 'Tips and Tricks'"
then click the link to sign up.
 
D

Dana DeLouis

and change the formula's to values.

Another technique is to loop on only Worksheets, and avoid the chance of
selecting a Chart Sheet, or an Excel 4 macro sheet.

Dim Sht As Worksheet
For Each Sht In ActiveWorkbook.Worksheets
Sht.Activate
'Your code ...
Next

HTH
Dana DeLouis
 
Top