Excel counting empty cells until first filled one

  • Thread starter Thread starter Rafael Martinez
  • Start date Start date
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
 
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
 
Back
Top