If you data is basically like this:-
Row No Col(H) Col(I)
1.
2.
3.
4.
5.
6. 2 people 1
7. 2 people 2
8. 1 people 3
9. 1 people 4
10. 1 people 5
Then this is the code:-
Sub MG23Jun15
Dim Lst As Long, c As Long, Rw As Long
Dim num As Integer
Rw = 5 'This is the start of RowNumber (optional for B2 on sample)
Lst = Range("I" & Rows.Count).End(xlUp).Row 'The EndRow where it shoulf be placed (optional for B5 on sample)
num = Range("E2").Value 'This is the number of items I need to equally distribute to each People
Do Until c = num
c = c + 1: Rw = Rw + 1
Cells(Rw, 8) = Cells(Rw, 8) + 1 'This is where the line error is
Rw = IIf(Rw Mod Lst = 0, 5, Rw) 'What is this code does? Not familiar
Loop
End Sub
Regards Mick
Bookmarks