• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Super Bowl Number Randomizer

Hi!

I am having issues with my number randomizer (button "Number Generator") and I am not sure how to fix it. It randomizes fine but when I am selling squares, I need the numbers to be blank.

So, if I take this workbook and clear the numbers, they become blank. But when I hit random, I get the same numbers that I had before on the first press. I would have to hit it twice to get a different set. This workbook will not age well if I want to use it going forward. I will have to know always know how many times to press it to get a true random which is no good. I am not getting a true and unique random with the current code that I have.

Any help or hints would be appreciated. Thanks!
 

Attachments

I had a button with code before that was just a clear contents for all of the number cells. I got rid of it because I thought it might be the fix. But you can recreate manually by selecting them and then hitting delete.

It is almost like my current randomizing code is have a memory. Set 1 of numbers, set 2 of numbers, and so on. It resets back to 1 whenever it clears. And I need to clear this every year.
 

p45cal

Well-Known Member
Yes, I had tried clearing them manually, but couldn't replicate what you're saying.
Try one thing for me and test if the problem goes away. Add:
Randomize
directly after:
Private Sub NumberGenerator_Click()
in your macro.

edit: I was able to reproduce what you describe, but only after resetting the Project in the VBE each time. My suggestion should solve this.
 
Last edited:
Top