+ Reply to Thread
Results 1 to 11 of 11

Auto select in a drop down box

Hybrid View

  1. #1
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    Try this...

    Sub Demo()
    MyList = Range("A1").Validation.Formula1
    MyArray = Split(MyList, ",")
    MyChoice = Int((UBound(MyArray) + 1) * Rnd())
    Range("A1") = MyArray(MyChoice)
    End Sub

    assuming validated cell is A1 and you have no commas in your possible validated values.

  2. #2
    Registered User
    Join Date
    02-23-2007
    Posts
    4
    Hey,

    Sorry to be a bit of a nuisance, but could you possibly apply the formula in a sheet and show me how t works... I'm a little confused.

    Thanks for this! your a life saver!

    aidan g.

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Its a macro, not a formula.

    Hit alt F11, right click on the explorer tree to add a module and paste the code in there.

    Then back on the worksheet, hit tools-macros-run to run the macro.

+ 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