Thread: Syntax help!
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Syntax help!

Mike,

You can loop thru the sheets and add the counts...
'--------------------
Sub HowMany()
Dim dblCount As Double
Dim lngIndex As Long

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

Regards,
Jim Cone
San Francisco, USA


"Mike Fogleman" wrote in
message ...
I am trying to put a calculated value in a cell without putting the formula
in the cell. VB will calculate and put result.
The syntax is killing me. What is it for this:
Range("I18").Value =
Application.WorksheetFunction.CountA('Sheet1:Sheet (Sheets.Count-2)'!A13:A100)
Mike F