I am trying to add a new row the cell (A,3) - Cell (A,2) is bigger than 2.5, and then on cell(A, new row) = value of Cell(A,2) +2.5.
I am using the below vba but not working could someone give me a hint please? Thanks.
Sub Main() Dim r As Range Dim i As Long i = 1 Do While Cells(1, 2) <> "" If ((Range("A" & i + "1") - (Range("A" & i))) > 2.5) Then i = i + 1 Rows(i).Insert Range("A" & i).Value = Range("B" & i - 1).Value End If i = i + 1 Loop End Sub
Bookmarks