Try and let us know if this is what uou look for
Sub test()
Dim x As Long, i As Long, mc As Long, myitem As String, mycapital As Double, myperiod As Double, bed1 As Double, geh1 As Integer
With Sheets("Sheet1")
For x = 2 To .Range("A" & Rows.Count).End(xlUp).Row
myitem = .Range("A" & x)
mycapital = .Range("B" & x)
myperiod = Application.Round(.Range("C" & x).Value, 1)
bed1 = Application.Round(mycapital / myperiod, 2)
geh1 = Int(.Range("C" & x))
ReDim arr(1 To geh1 + 1)
For i = 1 To geh1
arr(i) = bed1
Next
arr(UBound(arr)) = mycapital - (bed1 * geh1)
With .Range("1:1")
mc = .Find(myitem).Column
End With
.Cells(2, mc).Resize(UBound(arr)) = Application.Transpose(arr)
Next
End With
End Sub
Kind regards
Leo
Bookmarks