Hi
I'm not sure i understand - do you want to import the totals from another workbook and randomise the numbers to add to that total? If so, you could for example copy or link the target value to a particular cell (say A1) and change the formula to e.g.
Be careful though - if you're using this macro many times over many sheets it will take a long time to run and could freeze your machine.
Also note that the formula doesn't give completely random numbers - it generates random numbers between 75 and 150. If it could generate any random number then it would take too long and freeze your computer.
Random numbers between 75 and 150 work well for 8 people and a total of 1000, but for other total or other numbers of people you will need to adjust the formula or it may not work. The more people you have and the wider the range of possible numbers, the more time the macro will take and the more likely your computer will freeze. You should also have the expected average number per person in the middle of your random number range - for example, with 4 people aiming for a total of 24 you would want and range with 6 as the mid-point (e.g. 4 to 8)
Bookmarks