If column D is not a formula, you can use this modified macro:
Sub Macro3()
'
Dim C_ell As Range, Qty As Integer
For Each C_ell In Range("C2", Cells(Rows.Count, 3).End(xlUp))
If C_ell > 1 Then
Rows(C_ell.Row + 1 & ":" & C_ell.Row + C_ell - 1).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range(C_ell.Offset(0, -2), C_ell.Offset(0, 1)).Select
Selection.Copy
Range(C_ell.Offset(1, -2), C_ell.Offset(C_ell - 1, -2)).Select
ActiveSheet.Paste
C_ell.Resize(C_ell, 1).Select
Qty = C_ell
Selection = 1
C_ell.Offset(0, 1).Resize(Qty, 1).Select
Selection = C_ell.Offset(0, 1) / Qty
End If
Next
End Sub
Bookmarks