PDA

View Full Version : Solved: Return Sheet Index of Last Sheet



Saladsamurai
10-30-2009, 08:18 AM
I have a macro that contains a loop. At each iteration of the loop, a new worksheet is added before a worksheet named "summary."

So the sheet index of "summary" changes throughout the loop.

Is there a function that will return either the index based on sheetname?

Or a function that will simply return the number of sheets in a workbook? This will work just as well.

lucas
10-30-2009, 08:37 AM
Look into:

Worksheets.Count

Saladsamurai
10-30-2009, 10:04 AM
That will work. Thank you :)