Following code brings you the row number of last blank row in a table, even if there are blank values in table. This is because it travels from any below line to upward, reaches the last row with end(xlUp) and then addition of 1 provides you with last bank row. Here you may fill new data.
With wb.Worksheets("Sheet1")
r = .Range("A3000").End(xlUp).Row + 1
.Range("A" & r).Select
.Range("A" & r) = .Range("A" & r - 1).Value + 1
End With
With wb.Worksheets("Sheet1")
r = .Range("A3000").End(xlUp).Row + 1
.Range("A" & r).Select
.Range("A" & r) = .Range("A" & r - 1).Value + 1
End With
No comments:
Post a Comment