Worksheets.Count

Chris6629

New Member
Joined
Sep 22, 2014
Messages
4
Hi All

I have a workbook with multiple worksheets. Some worksheets have charts based on other Data Worksheets.

I notice that ActiveWorkbook.Worksheets.Count does not include Chart worksheets.

Example: if total number to worksheets in my workbook is 15 (10 data and 5 charts), then ActiveWorkbook.Worksheets.Count gives 10.

How to count worksheets with charts

Thank you
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Thx Mark
Got it, thank you very much, so there is a difference between Sheets.Count and Worksheets.Count
 
Upvote 0
Chart sheets aren't worksheets, so they don't get included in Worksheets.Count.
 
Upvote 0
Thx Mark
Got it, thank you very much, so there is a difference between Sheets.Count and Worksheets.Count

Hi Chris
Welcome to the board

The Sheets collection includes all types of sheets. There are 5 types of sheets: worksheets, chart sheets, and 3 other old types.

The Worksheets collections only includes the sheets of type worksheet.
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top