Select all worksheets

J

J Shrimps, Jr.

Have spreadsheets with up to five
individual workheets. Some have
as few as three, but most have five.
Need to cut-and-paste all formulas
into values for each worksheet.
Tried to create a macro the selects
each worksheet, and pastes the
entire worksheet as values, but
each worksheet is named differently,
so the macro only works on one
spreadsheet (and there's 11 of them).
'Spoze I could write a macro that
renames each of the worksheets
as "Sheet1", "Sheet2", "Sheet3",
etc, copies the contents of each
worksheet, and then renames them
back, but that seems kind of excesssive.
Isn't there a way to iterate through each
worksheet in a spreadsheet,
without having to select the
worksheet by name?
Can't change the name of the individual
worksheets.
 
B

Bob Phillips

No, just iterate through the worksheets collection in a For Each Next loop

For Each sh In Activeworkbook.Worksheets
sh,Cells.Copy
'etc
Next sh

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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