I need add 3 rows to the end of an excel file, and fill columns A-D with certain values
I know the code below can add one row and fill them with values
Is below the right way to add 3 new rows, and fill each cell in these rows with different values ?
I know the code below can add one row and fill them with values
VBA Code:
lr = Cells(Rows.Count, 1).End(xlUp).Row
Public lr As Long, lr2 As Long
lr2 = lr + 1
Cells(lr2, "A") = "One"
Cells(lr2, "B") = "Two"
Cells(lr2, "C") = "Three"
Cells(lr2, "D") = "Four"
Is below the right way to add 3 new rows, and fill each cell in these rows with different values ?
VBA Code:
lr = Cells(Rows.Count, 1).End(xlUp).Row
Public lr As Long, lr2 As Long
lr2 = lr + 3
Cells(lr2, "A") = "One", "One", "Five"
Cells(lr2, "B") = "Two", "Six", "Seven"
Cells(lr2, "C") = "Three", "Eight", "Nine"
Cells(lr2, "D") = "Four", "Ten", "Eleven"