Hi. Fairly new to Excel and I am running W10 with MS Office 365

 

I have a table (random D8 dice rolls) that generates random numbers 1-8 in each cell, these are dice rolls for D8s. There are 3 rows of 7 (21 dice in total). Row 1 is red dice, row 2 blue dice and row 3 green dice, 7 dice of each colour.

These dice roll results are then transferred to another table  (combat rolls) but only filling in the cells equal to how many dice have been rolled. So if a player rolls 3 of each colour, only the first 3 cells of each coloured row will show up. The remaining cells left blank. These values match the random roll values, which is great and what I wanted.

 

As we know when something is done in the sheet the random roll table (random D8 dice rolls) will update and copy the new values into my other table (combat rolls). I don't want this to happen. So I have created a new table and a Macro to copy and paste Values only from the table Combat rolls to a new table. The macro will copy and paste and will not change until I press the Macro button, even if the random roll table changes. This is what I wanted. However, values do not match what is being copied over. I have attached an image of the sheet explaining what happens and what is meant to happen. 

 

the macro to copy and paste values is 

 

Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim xSheet As Worksheet
Set xSheet = ActiveSheet
If xSheet.Name <> "Definitions" And xSheet.Name <> "fx" And xSheet.Name <> "Needs" Then
xSheet.Range("d12:j14 ").Copy
xSheet.Range("d22:j24").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End If

Application.ScreenUpdating = True
End Sub

You need to be a member of Fashion Industry Network to add comments!

Join Fashion Industry Network

Email me when people reply –

Replies

  • One possible solution is to ensure that the macro only copies and pastes the values when the button is pressed, without affecting the random roll table.
    I've had a similar situation when working with dice rolls for board games in Excel. To manage the randomness without constant updates, I used an online dice roller tool like https://dice.onl/ to generate the random numbers and then manually input them into Excel. This way, I had more control over when the values were updated.
    Online Dice — roll some virtual dice online!
This reply was deleted.

Forum Rules

PLEASE keep all discussions relevant to fashion, textiles, beauty products, or jewelry.

Follow the Fashion Industry Network Rules.

It is always a good time to review fabulous fashion.

 

Hot topics of possible interest:

  Thank you for using the Fashion Industry Network.  Have you helped another member today? Answer questions in the forum. It brings good luck.