i need one row between a constant difference.how to do that? if the row number change from (1 to x number )then how to fix ?
i need one row between a constant difference.how to do that? if the row number change from (1 to x number )then how to fix ?
try below
Sub insertR() Dim i As Long For i = Range("A65536").End(3).Row To 2 Step -1 If Cells(i, 1).Value > Cells(i - 1, 1).Value + 5 Then Rows(i).Insert shift:=xlDown End If Next i End Sub
Regards,
Nandkumar S.
---------------------------------------------------------------
Don't forget to Click on * if you like my solution.
Sub a() diff = 6 r = 2 While Cells(r, 1) <> "" If Abs(Cells(r, 1) - Cells(r - 1, 1)) = 6 Then Rows(r).Insert r = r + 1 Wend End Sub
If solved remember to mark Thread as solved
Thanks nandkumar sir it is solved.
Glad to help you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks