Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Count sheets in workbook
Is there a way to count the sheets in a workbook without doing it manually?
Cheers Shona |
#2
|
|||
|
|||
This macro should do it:
Sub shtcount() MsgBox "# of sheets: " & Sheets.Count End Sub Regards Rowan "SS" wrote: Is there a way to count the sheets in a workbook without doing it manually? Cheers Shona |
#3
|
|||
|
|||
Shona, here is one way,
Sub Count_WorkSheets() Dim c As Integer c = ActiveWorkbook.Sheets.Count MsgBox "There are " & c & " Sheet(s)" End Sub If you are new to Macros have a look here on getting started with macros http://www.mvps.org/dmcritchie/excel/getstarted.htm -- 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 "SS" wrote in message ... Is there a way to count the sheets in a workbook without doing it manually? Cheers Shona |
#4
|
|||
|
|||
Excellent thanks much quicker than than the way I thought of
Cheers Shona "Paul B" wrote in message ... Shona, here is one way, Sub Count_WorkSheets() Dim c As Integer c = ActiveWorkbook.Sheets.Count MsgBox "There are " & c & " Sheet(s)" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel should have a function to count sheets | Excel Worksheet Functions | |||
Numbering sheets in workbook | Excel Worksheet Functions | |||
Automatically copy selective sheets from one workbook to another | Excel Discussion (Misc queries) | |||
How to hyperlink from a workbook to sheets in another workbook? | Excel Worksheet Functions | |||
Copy comments to several sheets in a workbook? | Excel Worksheet Functions |