ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count number of sheets (https://www.excelbanter.com/excel-worksheet-functions/157727-count-number-sheets.html)

tc

Count number of sheets
 
Hi. I want to create a macro that will count the number of sheets in a
particular workbook. Is this possible?


Mike H

Count number of sheets
 
Try

Sub stantial()
numsheets = Worksheets.Count
end sub

Mike

"tc" wrote:

Hi. I want to create a macro that will count the number of sheets in a
particular workbook. Is this possible?



Gary''s Student

Count number of sheets
 
Use this UDF:

Function sheetcount() As Integer
sheetcount = Worksheets.Count
End Function

--
Gary''s Student - gsnu200743


"tc" wrote:

Hi. I want to create a macro that will count the number of sheets in a
particular workbook. Is this possible?



JE McGimpsey

Count number of sheets
 
Please don't post the same message in multiple newsgroups. It only tends
to fragment your answers, and potentially waste the time of those
answering questions that have already been answered...

In article . com,
tc wrote:

Hi. I want to create a macro that will count the number of sheets in a
particular workbook. Is this possible?


JE McGimpsey

Count number of sheets
 
Note that this will give you the number of sheet in the ACTIVE workbook,
not in "a particular" workbook...

In article ,
Gary''s Student wrote:

Use this UDF:

Function sheetcount() As Integer
sheetcount = Worksheets.Count
End Function

--
Gary''s Student - gsnu200743


"tc" wrote:

Hi. I want to create a macro that will count the number of sheets in a
particular workbook. Is this possible?



Tom Ogilvy

Count number of sheets
 
Worksheets would be a subset of the sheets in a workbook.

if there could be chart sheets or macro sheets (less likely) as well

activeworkbook.Sheets.count

--
Regards,
Tom Ogilvy


"tc" wrote:

Hi. I want to create a macro that will count the number of sheets in a
particular workbook. Is this possible?




All times are GMT +1. The time now is 01:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com