Excel counting empty cells until first filled one

B

Bernie Deitrick

Rafael,

Sub TryNow()
Dim myR As Range
Set myR = Range("A2")

If myR.Value = "" Then
MsgBox Range(myR, myR.End(xlDown)(0)).Rows.Count
Else
MsgBox "No blank rows"
End If
End Sub

HTH,
Bernie
MS Excel MVP
 
F

Francis

How about this

assuming your range is in A2 to A10,
=COUNTBLANK(A2:A10)
or

=COUNTIF(A2:A10,"")

--
Hope this is helpful

Pls click the Yes button below if this post provide answer you have asked

Thank You

cheers, francis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top