How to count number of sheets

T

T. Valko

One way...

Create this defined name...
Goto the menu Insert>Name>Define
Name: SheetNames
Refers to: =GET.WORKBOOK(1)&T(NOW())
OK

Then, to get the count of worksheets:

=COUNTA(INDEX(SheetNames,0))
 
F

FSt1

hi
i don't think there is a function that will do that. there used to be a call
function but that was removed in xl2k (i think) due to security issues.
here is a vb solutlions that works
Sub countworksheets()
Range("A1").Value = ActiveWorkbook.Sheets.Count
End Sub

paste the macro in a standard modual.

regards
FSt1
 

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

Top