Is there a piece of VBA the user can use that will count the number of worksheets within a workbook. So this value can then be stored as a variable.
Try the following:
Sub CountMe() MsgBox ThisWorkbook.Sheets.Count & " sheets available" End Sub
or to place the value in A1
Sub CountMe() Range("A1").Value = ThisWorkbook.Sheets.Count End Sub
Obtained from the OzGrid Help Forum.
Solution provided by xlite.
|How to count times between 2 specified times|
|How to use VBA script to count files/subfolders using a range from WB for the root folder|
|How to VBA code to count duplicates FAST|
|How to set a countdown timer to beep under 10 seconds|
|How to count the number of cells containing a comment that contains the word LATE|