countnonblank

F

famdamly

How does this work? I'm trying to come up with a macro that determines
the row of the first blank cell in a column. Any help would be
appreciated.
 
D

davesexcel

Sub Tst2()
Dim varnbrows As Double
Range("A1").Select
varnbrows = Selection.CurrentRegion.Rows.Count
If Selection.Value = "" Then
Exit Sub
ElseIf Selection.Offset(1, 0).Value = "" Then
Selection.Offset(1, 0).Select
Else
Selection.Offset(varnbrows, 0).Select
End If
End Sub

this will take you to the first empty cell in column A

copy and paste it into a module make a button assign this macro to it
 
Top