Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Workbook property telling number of sheets

Gentlemen and ladies,

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Workbook property telling number of sheets

One way:

nNumSheets = Workbooks("Workbook1.xls").Worksheets.Count


In article .com,
wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Workbook property telling number of sheets

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

wrote in message
oups.com...
Gentlemen and ladies,

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Workbook property telling number of sheets

Excellent. I am very grateful for your expertise.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Workbook property telling number of sheets

Excellent. I am very grateful for your expertise.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of Sheets in a workbook formula PCLIVE Excel Worksheet Functions 2 June 22nd 06 09:56 PM
max number of sheets possible in a workbook? Boon8888 Excel Discussion (Misc queries) 2 February 2nd 06 06:20 PM
Open workbook with x number of sheets Robert Christie[_3_] Excel Programming 4 November 11th 04 06:44 PM
Limit on number of Sheets in a Workbook? Mr B[_3_] Excel Programming 1 April 8th 04 08:03 PM
Return the number of Sheets in a Workbook gminor7[_3_] Excel Programming 3 November 17th 03 11:02 PM


All times are GMT +1. The time now is 06:17 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"