Counting Tabs in a Workbook

RolanDoobies

Board Regular
Joined
Aug 28, 2002
Messages
99
Is there a process for counting tabs in a workbook?
I have over 65 of them so I'm looking for a shortcut.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Zack Barresse

MrExcel MVP
Joined
Dec 9, 2003
Messages
10,881
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web
try ASAP utilities, it has a great index function, much like a TOC, which adds hyperlinks to each sheet. not exactly what your asking for, but it will work and it's a must have.
 

MartinK

Active Member
Joined
Oct 30, 2003
Messages
384
Hello, try:

<pre><SPAN style="color:#00007F">Sub</SPAN> SheetCount()
MsgBox ThisWorkbook.Sheets.Count
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>

<SPAN style="color:#00007F">Function</SPAN> SheetCnt()
Application.Volatile
SheetCnt = ThisWorkbook.Sheets.Count
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Function</SPAN></PRE>

the latter can be used as =SheetCnt() in your worksheet

Martin
 

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
Try this vba code. Press alt + F11 to open vbe and paste this code in a module and run it.

Sub TabCount()
MsgBox ("There are " & Sheets.Count & " Tabs in " & ActiveWorkbook.Name), vbInformation
End Sub

Hope this helps

Jacob
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,560
Messages
5,765,091
Members
425,258
Latest member
brentmitchell

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