Hi all,


I need to create a macro that distributes proportionally a value into several columns taking into account that the value changes in each row. One important point is that the first column in which I have to start is previously stated.

Let's take that the value is 1000 and it must paste in each column 150, starting from the thirth. I would have 0,0,150,150,150,150,150,150, and in the next one only 50 (what I have left) . In the rest, all would be 0 again, until the last one.

The loops I'm creating don't work because I'm unable to count all the cells with data in each row (I'm using "endd = Cells(1, Cells.Columns.Count).End(xlToRight).Column")
but I'm sure there are more wrong things over there.

I know that there are here many very good experts... Would be anyone of you able to give a macro capable to do all these things??



Thank very much in advance for your kind answers.