+ Reply to Thread
Results 1 to 11 of 11

Auto select in a drop down box

Hybrid View

aidang Auto select in a drop down box 02-23-2007, 03:25 AM
mrice Response 02-24-2007, 06:12 PM
aidang Hey, Sorry to be a bit of... 02-25-2007, 01:36 AM
mrice Its a macro, not a formula. ... 02-25-2007, 02:38 PM
Teethless mama Assuming name list in A2:A10... 02-26-2007, 12:27 AM
aidang thanks for all your... 03-01-2007, 02:56 AM
aidang hey. im sorry mrrice, but... 03-01-2007, 03:02 AM
mrice Here's the macro inserted -... 03-01-2007, 03:44 PM
textexpress Re: Auto select in a drop... 12-18-2013, 09:05 PM
arlu1201 Re: Auto select in a drop... 12-19-2013, 01:42 AM
textexpress Re: Auto select in a drop... 12-19-2013, 10:19 AM
  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.
    Martin

  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