Hi
Is there an easy way to step through sheets in an excel macro when you don't know how many sheets there are ( workbook is output by system, and number of sheets will vary ), I can do....
SheetNum = 1
Do
SheetName = "Sheet" & SheetNum
Sheets(SheetName).Select
'Perform action on sheet here.
SheetNum = SheetNum+1
Loop until SheetNum = x
Is there a macro function which can tell me how many Sheets there are ?, i.e. the value of x
Thanks for your help
Gav
Is there an easy way to step through sheets in an excel macro when you don't know how many sheets there are ( workbook is output by system, and number of sheets will vary ), I can do....
SheetNum = 1
Do
SheetName = "Sheet" & SheetNum
Sheets(SheetName).Select
'Perform action on sheet here.
SheetNum = SheetNum+1
Loop until SheetNum = x
Is there a macro function which can tell me how many Sheets there are ?, i.e. the value of x
Thanks for your help
Gav