Loop through sheets

  • Thread starter Thread starter michael
  • Start date Start date
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
 
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.
 
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
 

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

Back
Top