Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,470
    Thanks
    30
    Thanked 62 Times in 58 Posts
    I have a simple macro and button that generates a random number between 1-100. Then, I use this random number to select a cell from another sheet (a word definition). I want a user to input the word based on this definition, then I'll check to see if it's correct.

    Every time I enter a word to match the definition, touch the ENTER key, the definition changes because of the RANDBETWEEN function in one of the cells.

    I guess what I need to know is what instruction do I put in the macro to generate this random number so that the definition selection doesn't change without the user clicking the button. I also need to know the random number that was generated so that I can check for the correct solution.

    I sure hope this makes sense.

    Thanks in advance.

  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use something like:
    [codeRange("A1") = Application.WorksheetFunction.RandBetween(1,100)][/code]

    The value in A1 will be a value and not the formula.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •