Computers » Excel

ID #1135

Is there a simple, quick way to count how many worksheets are within a workbook?

It's not really that simple or quick...

Open Excel and create a new workbook. Open the VB Editor using <Alt> F11. Double-
click on ThisWorkbook to bring up a code window on the right. Paste in the
following lines:

		Option Explicit	Sub CountSheets()	Dim iSheetCount As Integer	iSheetCount = ActiveWorkbook.Worksheets.Count	MsgBox iSheetCount	End Sub	
	

Switch back to Excel and run the subroutine by using <Alt> F8 to bring up the
macro list and double-clicking on CountSheets. A dialog box will display the
number of worksheets.

(see Excel Tutorials)

 

Tags: excel

Related entries:

Last update: 2008-04-01 21:06
Author: Ask MIStupid
Revision: 1.22

Please rate this entry:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You can comment on this entry



Sponsored Links (excel)