First thanks in advance for any advice.
I have a reviewed a lot of examples that selects the last row working from bottom up. The main issue I have is that I have a column of data that starts at row 20 and I need to determine the last cell when the loop hits the second blank row working down from Row 20 since there is information after the second blank row and to make it more difficult there is a 1 blank row in the column before the next two blank rows (which is the row i need).
I tried the following:
Sub testlr()
'
'Dim Lastcella As Long
'Dim SecondLastcella As Long
'
'With Sheets("REG")
'
'Lastcella = .Cells(.Rows.Count, "A").End(xlDown).Row + 20
'
'Debug.Print Lastcella
'
'SecondLastcella = Lastcella - 1
'Do While .Cells(SecondLastcella, "A") = ""
' SecondLastcella = SecondLastcella - 1
'Loop
'
'End With
'
'Debug.Print Lastcella
'
'End Sub
This gives me the last row in the worksheet so its not working right and I am not sure how to proceed.
Thanks for all on this board with their advice. It is greatly appreciated.
I have a reviewed a lot of examples that selects the last row working from bottom up. The main issue I have is that I have a column of data that starts at row 20 and I need to determine the last cell when the loop hits the second blank row working down from Row 20 since there is information after the second blank row and to make it more difficult there is a 1 blank row in the column before the next two blank rows (which is the row i need).
I tried the following:
Sub testlr()
'
'Dim Lastcella As Long
'Dim SecondLastcella As Long
'
'With Sheets("REG")
'
'Lastcella = .Cells(.Rows.Count, "A").End(xlDown).Row + 20
'
'Debug.Print Lastcella
'
'SecondLastcella = Lastcella - 1
'Do While .Cells(SecondLastcella, "A") = ""
' SecondLastcella = SecondLastcella - 1
'Loop
'
'End With
'
'Debug.Print Lastcella
'
'End Sub
This gives me the last row in the worksheet so its not working right and I am not sure how to proceed.
Thanks for all on this board with their advice. It is greatly appreciated.