MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Number of Sheets


Posted by jssp on August 27, 2001 8:54 AM


Hello Everyone:

Does anyone know how to count the number of sheets
in a given Workbook and asign this value to a
variable?

Thanks in advance for all youe help!!!


Posted by Dax on August 27, 2001 8:59 AM

This:-

Sub SheetCount()
Dim lngNumberOfSheets As Long
lngNumberOfSheets = ThisWorkbook.Sheets.Count
MsgBox lngNumberOfSheets
End Sub

Regards,
Dax.

Posted by jssp on August 27, 2001 10:40 AM

Thanks!!! (NM)