Find second blank row

  • Thread starter Thread starter singlgl1
  • Start date Start date
S

singlgl1

Can someone edit this so that it will find the second blank row instead
of the first blank row? Thanks


Function FindBlankRow()
x = 2
Do While ActiveSheet.Cells(x, 1) <> ""
x = x + 1
Loop
FindBlankRow = x - 1
 
Function SecondBlankRow()
Dim CountToGo, CurRow As Long
CountToGo = 2
CurRow = 2
Do While CountToGo > 0
If ActiveSheet.Cells(CurRow, 1) = "" Then CountToGo = CountToGo - 1
CurRow = CurRow + 1
Loop
SecondBlankRow = CurRow - 1
End Function

Note that this isn't really finding the 2nd blank row, but rather the 2nd
row (ignoring row 1) that has a blank cell in column A (that's true of this
function as well as your original).
--Bruce
 

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

Back
Top