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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
14,470
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
Try ActiveWorkbook.Sheets.Count
 

Chris6629

New Member
Joined
Sep 22, 2014
Messages
4
Thx Mark
Got it, thank you very much, so there is a difference between Sheets.Count and Worksheets.Count
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
Chart sheets aren't worksheets, so they don't get included in Worksheets.Count.
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,887
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,602
Messages
5,838,321
Members
430,538
Latest member
PedroOliveira

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
Top