View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
PCLIVE PCLIVE is offline
external usenet poster
 
Posts: 1,311
Default How do I use workbook.sheets.count

Press Alt+F11.
Double-click on 'ThisWorkbook'.
Paste the following code

Private Sub Workbook_Open()
Range("A1").Value = Sheets.Count & " Worksheets"
End Sub


HTH,
Paul

"dradon" wrote in message
...
I want to use the code above but don't know anything about VBA. The goal
is
to have the number worksheets displayed in cell A1 on the first worksheet
everytime I open this file.