Workbook property telling number of sheets

  • Thread starter Thread starter michael_mcclellan
  • Start date Start date
M

michael_mcclellan

Gentlemen and ladies,

Does anyone know of a way to obtain in VB the number of sheets that
exist in a given workbook?
 
One way:

nNumSheets = Workbooks("Workbook1.xls").Worksheets.Count
 
Michael, use Sheets.Count something like this
Sub sheetcount()
MsgBox "There Are " & Sheets.Count & " Sheet(s) in this workbook"
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 

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

Back
Top