Count sheets

  • Thread starter Thread starter Dale
  • Start date Start date
D

Dale

Hi, is there a way I could display how many sheets I have in a workbook

Thanks
 
use this code/function:

Function sheet_count() As Integer
sheet_count = ThisWorkbook.Sheets.Count
End Function

press ALT+F11 to open Microsoft Visual Basic window
click Insert->Module
paste the code there

then in any cell insert:
=sheet_count()

ATTENTION: the function ALL sheets in the workbook, including chart
sheets and hidden sheets

pls click YES if this post was helpful
 
Try this udf:

Function sheetcount() As Long
sheetcount = Sheets.Count
End Function
 

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