Sunday, July 22, 2018

How to Reach Last Blank Row in a Column

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

No comments:

Post a Comment

Autofilter: To filter with macro

Below is very basic macro to define filter on atable which has two columns. Name(Comuln A) and Dept(Column B). Function will filter all emp...