PDA

View Full Version : [SOLVED] Macro adds a row and make a change



osevero
10-06-2013, 07:07 PM
Hello everyone!


I plan to create a macro that adds a row with clean cells, keeping the formulas and make +1 to the value of the ID of the previous row.

10668

In this case, the next ID value would be 3.

Help please,
Cheers

patel
10-06-2013, 11:33 PM
Sub a()
LR = Cells(Rows.Count, "A").End(xlUp).Row
Rows(LR).Copy Rows(LR + 1)
Range("A" & LR + 1) = Range("A" & LR) + 1
Range("B" & LR + 1 & ":C" & LR + 1) = ""
End Sub

osevero
10-11-2013, 06:04 PM
Thanks a lot!! Cheers