+ Reply to Thread
Results 1 to 2 of 2

How to Create a Random Generator

  1. #1
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    How to Create a Random Generator

    Hello,

    Can anyone help me? I would like to create a random calculation through vba that will pick a persons name. I would like it to first choose a state, then choose a gender(male of female), then based on the state and gender it will select a name from a group specific to the state and gender. i have try this using the rand and rank functions but i'm certain that there is an easier way.

    I attached a file with what i have attempted so far but failed. Attachment 209596ed

    If any of what i explained does not make any sense i apologize and would be more than happy to clarify.

    Thank you,
    Attached Files Attached Files
    Last edited by Justair07; 01-25-2013 at 03:53 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to Create a Random Generator

    Hi,

    Does the attached help.

    It requires your data to be listed as in sheet 2, i.e. a straight forward list rather than in blocks) The helper column in column D is an array formula entered with Ctrl Shift Enter. Press F9 and each time a calc takes place you'll see the names randomly distributed in column G
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: How to Create a Random Generator

    I was hoping that there was a way for the gender and state to follow along woth the name as well when it changes. Not sure if thats possible?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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