View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dallman Ross Dallman Ross is offline
external usenet poster
 
Posts: 390
Default Count filled data rows until empty

In , Dallman Ross <dman@localhost.
spake thusly:

In VBA, how can I count the filled cells in a column until
the first empty cell? Thanks for any help, folks.


Man, but it is amazingly quiet in here. I am having a monologue
lately.

After much scrambling around on the net I came up with this, thanks
in no small part to the great MVP tip pages over at ozgrid.com.

Particularly helpful was http://www.ozgrid.com/VBA/VBALoops.htm

So here is what I have:

Public Function RcountTillBlank()
Cells.Find(What:="", After:=[A1], LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase _
:=False, SearchFormat:=False).Activate
RcountTillBlank = ActiveCell.Row - 1
End Function


That works and I like it. But if anybody can tell me how to make it
take an argument for the range to start the search from, that would be
super. Or any other comments about the above, for that matter.

=dman=