Hello. Could someone explain in detail what each piece of this code means/does? Thanks.
Sub Onadd()
Dim rng As Range
Dim intRow As Integer
With Range("Number")
Set rng = .Cells(Rows.Count, 1).End(xlUp)
intRow = 1
Do Until intRow > rng.Row
If IsNumeric(.Cells(intRow)) And .Cells(intRow).Value > 0 Then
intRow = intRow + 1
Rows(intRow & ":" & intRow + .Cells(intRow - 1).Value - 1).Insert
.Cells(intRow) = 0
intRow = intRow + .Cells(intRow - 1).Value - 1
End If
intRow = intRow + 1
Loop
End With
End Sub
Bookmarks