The following code has worked before, but now it doesn't and I can't figure out why. I just determine the value in the activecell and if it's more than one I just copy the row and insert it below the selected row, but for some reason I get a runtime error 1004 and the insert method fails. I also note that the "i" in insert is not capitalized. Can anyone assist me?
Code:
Sub Deaggregate_returns()
' change multiple returns of same product to single returns
Dim qty As Integer, irow As Long, MyCell, step As Integer
Set MyCell = ActiveCell
While ActiveCell.Value <> ""
qty = ActiveCell.Value
For step = 1 To qty - 1
Rows(ActiveCell.Row).Select
Selection.Copy
Selection.insert Shift:=xlDown
Next step
MyCell.Offset(1, 0).Select
Set MyCell = ActiveCell
Wend
End Sub