Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub test_v2()
- Dim i As Long, j As Long
- i = Cells(Rows.Count, "A").End(xlUp).Row
- Application.ScreenUpdating = False
- For j = i To 1 Step -1
- If Cells(j + 1, 1) <> "" Then
- If Cells(j + 1, 1).Value - Cells(j, 1).Value > 1 Then
- x = Cells(j + 1, 1).Value - Cells(j, 1).Value
- Rows(j + 1 & ":" & x + j - 1).Insert
- End If
- End If
- Next j
- With Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
- .Formula = "=Row()"
- .Value = .Value
- End With
- Application.ScreenUpdating = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment