Thread: Syntax help!
View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Syntax help!

Sorry, sent wrong reply. The audit sheet (104) shows a count for the 2
permanent sheets, which throws it off by 90. And this total is different
from the one in my sheet using your original loop.
"Jim Cone" wrote in message
...
Mike,

Do an audit...
But first add a blank sheet as the last sheet.
'---------------------
Sub HowMany()
Dim dblCount As Double
Dim dblShtCnt As Double
Dim lngIndex As Long

For lngIndex = 1 To (Worksheets.Count - 2)
dblShtCnt = Application.CountA(Worksheets(lngIndex).Range("A13 :A100"))
Worksheets(Worksheets.Count).Cells(lngIndex, 2).Value =
Worksheets(lngIndex).Name
Worksheets(Worksheets.Count).Cells(lngIndex, 3).Value = dblShtCnt
dblCount = dblCount + dblShtCnt
dblShtCnt = 0
Next 'lngIndex
Range("I18").Value = dblCount
End Sub
'--------------------------

Jim Cone
San Francisco, USA


"Mike Fogleman" wrote in
message ...
True, but there are no charts. Could it be because the sheets are made on
the fly and the workbook has not been saved yet for Excel to recognize the
sheets index?



"Jim Cone" wrote in message
...
Mike,
I don't know, however, fwiw, there can be a difference between
Sheets.Count and Worksheets.Count.
Jim Cone
San Francisco, USA