+ Reply to Thread
Results 1 to 5 of 5

Random selection of a data located in a column, by text color

  1. #1
    Registered User
    Join Date
    01-11-2009
    Location
    Woodland, CA
    MS-Off Ver
    Excel 2003
    Posts
    27

    Random selection of a data located in a column, by text color

    I am wondering, in excel 2003 is it possible to randomly select two numbers from one column, say column b9:b45, that are random numbers, and selected by two different font colors. In other words: b9=1348, b10=1349, b11=1350, b12=1351, b13=1352, b14=1353.

    Say we press a macro button, and in field B50 one radom black colored number is selected of a field of say 30 numbers that are all black in that column, and in b51, one red number is selected, in a field of 30 red numbers.

    We want to used this macro to select winners simulating a raffle drawing.

    Thanks for your insights
    Last edited by gmaz2; 02-10-2009 at 04:06 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Random selection of a data located in a column, by text color

    The colors are irrelevant. You can think of them as "black" and "red" ranges if you want, but don't mix that thinking up into your logic.

    Just setup two sets of numbers and use a standard random "selector" formula. Like the attached sample.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    01-11-2009
    Location
    Woodland, CA
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Random selection of a data located in a column, by text color

    Thank you very much, had to access add-ins in excel and set those fields within it to generate the number, but it worked. One particular note: our numeric data is listed in one Column only, so we can press F9 until we get a boy/girl number selected.

    Take Care and thanks once again.
    Last edited by gmaz2; 02-06-2009 at 02:28 AM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Random selection of a data located in a column, by text color

    If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

  5. #5
    Registered User
    Join Date
    01-11-2009
    Location
    Woodland, CA
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Random selection of a data located in a column, by text color

    Before I close this, the way the spread sheet is developed, can a formula be made to pull the random number to a given field, the number selected say is
    B12, in column C is a name typed in the field, then say at b70, the random number is pull into that field, and then the name found in c70 is inserted next to the random number?? this could denote the boy, then on the row below that, say B72, and C72, the same occur from the second random (F9) attempt>

    ie
    PHP Code: 
                           Column B            Column C

    Row 9                8                       John Doe

    Row 16              20                     Mary Smith


    Summary of Random Selection after entering F9

    Row 70              8                        John Does

    Row 72             20                       Mary Smith 
    Last edited by gmaz2; 02-08-2009 at 12:09 AM.

+ 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