Count the number of sheets.

O

Olle Svensson

Hi.

I want to do the simplest thing possible; count the number of sheets in a
workbook and show the result in a cell.

See, basically, I want every new copied sheet to have a reference in a cell
like this:
=(numberofsheets)-1

I know about the footer and header but I have sheets that are for summary
and index reasons which would throw off the count of the sheets I intend to
copy.

Not sure if this makes any sense, I pretty much just want to count the
number of sheets with a formula.

Thank you,
Olle Svensson
 
B

Bob Phillips

In vba you can get the count with

ACtiveworkbook.Sheets.Count

So I think you would need to incorporate that in a UDF.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
O

Olle Svensson

Thank you, but I'm afraid that does not really help me. See I'm only using it
for a little thing that could be done manually without effort so creating
macros and UDF's seems rather overkill.

Is it not a rather big mistake that MS did not bother to put in a simple
function for this?
 
B

Bob Phillips

Not really, the demand for it is very low.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Top