Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I use workbook.sheets.count

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
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.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default How do I use workbook.sheets.count

right click the excel icon in the upper left cornercopy paste thismodify
to suitsave workbook.
Private Sub Workbook_Open()
Sheets("sheet1").Range("a1") = ActiveWorkbook.Sheets.Count
End Sub


--
Don Guillett
SalesAid Software

"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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"