Copy and paste values automatically to empty cells below

Closed
m22capital Posts 1 Registration date Saturday April 15, 2017 Status Member Last seen April 15, 2017 - Apr 15, 2017 at 07:07 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 24, 2017 at 11:57 AM
Hi - for background, I created a "slot Machine" in excel that combines three random number generators and generates either a -$1 or +$10 if you don't have 3 of the same numbers in a row (lose) or if you do have 3 numbers in a row (win).

I want to track the number of losses and wins (both the absolute amount (in theory I would like to roll thousands of times) and the rolls' specific values ($-1 or +$10)). How do I copy the win or loss value of any one "roll" and paste it to another sheet and then copy the next win or loss value and paste it in the cell below the prior win or loss value and so on (so i could track thousands of "rolls")?

I also want to sum these values so i need to create a sum calculation that automatically increases its range as the number of "rolls" increases.

Thanks in advance.

1 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Apr 24, 2017 at 11:57 AM
Hi m22capital,

How do you start a 'roll'?

When you use a command button, then you can add to that code. Copy the 3 cells and paste them to the first available row on a new sheet (Sheets("Sheet2").Range("A"&rows.count).end(xlup).offset(1,0).pastespecial)

As for the sum calculation use the 1st or 2nd row for that and total the entire column. No need to continually adjust the formula.

Can you make this work?

Best regards,
Trowa
0