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.
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.
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,215,008
Messages
6,122,672
Members
449,091
Latest member
peppernaut

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