+ Reply to Thread
Results 1 to 5 of 5

Create a Macro Button to randomly generate numbers only on click

  1. #1
    Registered User
    Join Date
    07-17-2014
    Location
    Springdale, AR
    MS-Off Ver
    office 2016
    Posts
    12

    Create a Macro Button to randomly generate numbers only on click

    I am sorry if this has been explained before, I am not having any luck finding the answers that make sense to me.
    I am trying to have Excel create random tests from the questions in my data base of questions and I have gotten it to work and display like I want it to using the Rand() and Rank() functions for each question but the problem I am having is every time I click some place excel generates new random numbers and then I lose the question order before I have a chance to print off the tests or answer key.

    Is there a way to create a Macro button that will create the random numbers only when the button is clicked, this way if i accidentally click anywhere on the spread sheet it wont recalculate the random numbers?

    I would like the button to be on Tab 4 but affect the Rand() function on Tab 1 Column B Rows 2 to 81. Also how hard will it be to change if I were to add more rows to Tab 1 in the future?
    Thanks
    Seth

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Create a Macro Button to randomly generate numbers only on click

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    07-17-2014
    Location
    Springdale, AR
    MS-Off Ver
    office 2016
    Posts
    12

    Re: Create a Macro Button to randomly generate numbers only on click

    here is a copy of my spread sheet
    Attached Files Attached Files

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Create a Macro Button to randomly generate numbers only on click

    See attached workbook. Button on DB sheet.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-17-2014
    Location
    Springdale, AR
    MS-Off Ver
    office 2016
    Posts
    12

    Re: Create a Macro Button to randomly generate numbers only on click

    That is exactly what I needed thank you!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to generate groups randomly of 20 numbers, being 10 of group A and 10 of group B,
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-14-2017, 08:02 AM
  2. Have Word randomly generate numbers.
    By atomichybrid in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2015, 05:55 AM
  3. Function inside a button to randomly generate number?
    By fkalinx in forum Excel General
    Replies: 2
    Last Post: 09-16-2014, 03:31 PM
  4. Replies: 3
    Last Post: 08-21-2012, 07:28 PM
  5. [SOLVED] generate button click
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2006, 05:45 PM
  6. How to generate a list of randomly selected numbers within a range
    By Bob in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-07-2005, 02:15 PM
  7. I WOULD LIKE TO RANDOMLY GENERATE FROM LIST I CREATE ON SAME PAGE
    By totalmaker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2005, 11:05 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1