Ellias_Adelle
New Member
- Joined
- Sep 13, 2021
- Messages
- 7
- Office Version
- 365
- Platform
- Windows
Hello,
I'm pretty new to working with macros, so I hope I'm sorry if this seems easy to you. It has been stumping me for days and I can't figure it out no matter how much research I do.
What I am trying to do is compare a random number between 1 and 100 (no decimals) to a value in a cell and if that value is above that number I want to permanently add a random number (no decimals) between 1 and 10 to that number.
For example, if the value is 70 I would like the macro to add a random number between 1 and 10 to it 30 percent of the time. Let's say the macro increases the number to 76. If activated again I want it to have a 24 percent chance of increasing the number again.
If there is an easier way to do this than creating a random number and comparing it to the value I'm fine with that. I so long as the results are the same.
I don't want to have a value for the random numbers be posted in the workbook.
I'm pretty new to working with macros, so I hope I'm sorry if this seems easy to you. It has been stumping me for days and I can't figure it out no matter how much research I do.
What I am trying to do is compare a random number between 1 and 100 (no decimals) to a value in a cell and if that value is above that number I want to permanently add a random number (no decimals) between 1 and 10 to that number.
For example, if the value is 70 I would like the macro to add a random number between 1 and 10 to it 30 percent of the time. Let's say the macro increases the number to 76. If activated again I want it to have a 24 percent chance of increasing the number again.
If there is an easier way to do this than creating a random number and comparing it to the value I'm fine with that. I so long as the results are the same.
I don't want to have a value for the random numbers be posted in the workbook.