View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default No Message

Try again

You can count the number of non-blank cells in a range like so

myVar = Application.COUNTA(Range("A1:B10")

but not the number of blank rows, because if two cells on the same row have
data, you will get 2 not 1.

To get that, you would need to check each row, like so

Dim oRow As Range
Dim cNonBlanks As Long

For Each oRow In Range("50:80").Rows
If Application.CountA(oRow) < 0 Then
cNonBlanks = cNonBlanks + 1
End If
Next oRow



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Gerrym" wrote in message
...

Bob
Your reply didn't come through.

Gerry

-----Original Message-----
Message unavailable