+ Reply to Thread
Results 1 to 5 of 5

Excel button to randomly select from list

  1. #1
    Registered User
    Join Date
    05-26-2021
    Location
    Nevada
    MS-Off Ver
    Windows 10
    Posts
    2

    Excel button to randomly select from list

    Hi,

    I have a list of names in column A and placed a button between columns B-D. How do i make it so that when i click the button it will randomly select from column A and list on Cell B5.

  2. #2
    Forum Contributor
    Join Date
    05-18-2021
    Location
    London, Ontario
    MS-Off Ver
    365
    Posts
    115

    Re: Excel button to randomly select from list

    assign it a macro:

    Sub choose()

    Dim row As Integer

    'this range in the brackets should be the first and last row of your list on column A
    row = WorksheetFunction.RandBetween(2, 10)

    ActiveSheet.Range("B5") = Range("A" & row)

    End Sub

  3. #3
    Registered User
    Join Date
    05-26-2021
    Location
    Nevada
    MS-Off Ver
    Windows 10
    Posts
    2

    Re: Excel button to randomly select from list

    That works Thank you!!!
    Last edited by shineres; 05-26-2021 at 01:55 PM.

  4. #4
    Forum Contributor
    Join Date
    05-18-2021
    Location
    London, Ontario
    MS-Off Ver
    365
    Posts
    115

    Re: Excel button to randomly select from list

    change the part in RandBetween, i.e. "RandBetween(first row, last row)"
    then keep the rest as it was originally

  5. #5
    Forum Contributor
    Join Date
    05-18-2021
    Location
    London, Ontario
    MS-Off Ver
    365
    Posts
    115

    Re: Excel button to randomly select from list

    Quote Originally Posted by shineres View Post
    That works Thank you!!!
    if you could add reputation i would appreciate it (star button on bottom left)

+ 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] Randomly select 25% of list and copy to new tab
    By fatboyzfishing in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-14-2023, 08:31 PM
  2. Macro To Randomly Select From List and Place In New Cell
    By ssjagger in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2016, 01:04 PM
  3. RANDomly select from list IF criteria is met
    By Framci in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-30-2015, 05:49 PM
  4. [SOLVED] Randomly select one of two cells to populate from a list
    By 90Shilling in forum Excel General
    Replies: 1
    Last Post: 10-17-2013, 12:04 PM
  5. [SOLVED] if restriction is not met, select another word randomly from the list
    By bloem in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-11-2013, 10:52 AM
  6. Randomly select from long list
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-17-2011, 08:08 PM
  7. How to randomly select from a list with condition
    By kathyxyz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-27-2005, 11:19 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