+ Reply to Thread
Results 1 to 5 of 5

Random cell selct/highlighting

  1. #1
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Random cell selct/highlighting

    Hi all,

    I was wondering if someone could help me with, probably a very simple, problem.
    I have classroom seating plans set out with names in cells to represent desks, and am looking for some way to automatically highlight one of the names at random (completely randomises who I direct questioning to). I can do this easily as a list, but want it to actually highlight the person in the seating position, not just the name. I have attached a file showing how I’ve done it as a list (sheet 1) and an example of my seating plan on (sheet 2).
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Random cell selct/highlighting

    see sheet 2 press f9 to re select
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Re: Random cell selct/highlighting

    Awesome, thanks very much for your help.

    Could you tell me how it is done?

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Random cell selct/highlighting

    yep
    the cells a1:j9 have the following condtional format
    in the formula is option
    =A1=INDEX($L$1:$L$26,MATCH(MAX($M$1:$M$26),$M$1:$M$26,0))
    this looks at the table on the right l1:m26
    in column m1:m26 there is =rand() which generates a random numbers
    the formula looks for the maximum rand value
    thats this bit
    MAX($M$1:$M$26),
    then uses match to find out what row its in
    MATCH(MAX($M$1:$M$26),$M$1:$M$26,0)
    the row is then used in the index f1:f26
    to get the value from that cell
    say its A
    then in conditional formatting you test for true/false
    so essentially it says if this cells value is = to result of the index/match return true and use the format selected

  5. #5
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Re: Random cell selct/highlighting

    That's graet, thanks.

+ 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