Thread: VBA question
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default VBA question

Sub countum()
Set r = Range("C20:L2000")
Set terminus = Nothing
For Each rr In r
If IsEmpty(rr) Then
Else
Set terminus = rr
End If
Next
MsgBox (terminus.Row - r.Row + 1)
End Sub
--
Gary''s Student - gsnu200834


"ub" wrote:

Hi
I have a range defined as Range("C20, L2000"). I want to find the last
record in the range that has any value and then count the number of rows in
this range
Please advise