+ Reply to Thread
Results 1 to 9 of 9

Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

  1. #1
    Forum Contributor
    Join Date
    05-17-2007
    Location
    Michigan, US
    MS-Off Ver
    2007
    Posts
    111

    Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

    I found an extremely neat trick yesterday, competely by accident while making and testing a spreadsheet. I am so thrilled with this accidental discovery that I thought I would share it with the community, just in case some of you are not already aware.

    I know there is not much of a chance of me teaching any of you experts anything new, but if in fact you were not aware of this neat little trick I would appreciate you replying letting me know, so I can get a little satisfaction about helping all of you who have helped me so much.

    Go to the last open cell at the bottom of any column which contains text. There cannot be any empty cells in the column or this trick will only return the value of the cell directly above the cell you are in. There can be numeric values in some of the cells and text in others, but only the cells which contain text will show up in the combo box. There can even be formulas pointing to text values in other cells and those results will show up in the combo box. OK, now that your in the last open cell at the bottom of a column of contiguous data, hold down the alt key and hit the down arrow.

    You should see a combo box with a sorted list of all the unique values. After the combo box appears you can let go of the alt key and then use your up and down arrows to navigate to the selection you want. Once your selection is highlighted just hit enter.

    The other neat thing about this trick is that you don't have to be on the last open cell at the bottom of the column of data for it to work. You can be anywhere in a column of contiguous data and the combo box will display the items not only above your active cell, but below you as well.

    As I said, I found this out by accident yesterday. I can't believe I didn't figure it out sooner as I use the Alt Down Arrow trick all the time to select values in a combo box, and I would have thought I would have mistakenly tried it on cells which did not contain data validation before yesterday, but I guess not.

    By the way, it was Pjoaquin, or Paul as he is now known, who taught me how to use Alt Down Arrow in the first place to select items in a combo box back in a thread here in 2007. http://www.excelforum.com/excel-gene...elections.html

    Sorry to get so excited about this discovery if this is common knowledge, but in case it isn't I thought I would pass it along. It sure beats hitting the up arrow a bunch of times to go to another cell and then copying, then hitting the down arrow a bunch of times and then pasting, or using your mouse to do all that.

    Spence

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

    Hi Spencer,
    I didn't know this shortcut but it looks the same as
    Pick from Dropdown List.
    http://office.microsoft.com/en-us/ex...001098273.aspx

    In 2010 Excel I can right click on a cell and get the options to Pick from Dropdown list.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

    If it is the Pick from list feature, it's been available in all the versions of Excel that I have worked with.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Contributor
    Join Date
    05-17-2007
    Location
    Michigan, US
    MS-Off Ver
    2007
    Posts
    111

    Re: Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

    Quote Originally Posted by royUK View Post
    If it is the Pick from list feature, it's been available in all the versions of Excel that I have worked with.
    I just did a quick search on "Pick From List" and sure enough, that is exactly what I am talking about. The description I just found states to right click and choose "Pick from drop down list..." from the context menu, which does the exact same thing that I was describing above with the Alt Down Arrow method.


    Spence

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

    I've moved this to "Tips & Tricks"

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

    You'll find that the ALT-Down_Arrow combination is fairly versatile.
    It works in most places that contain dropdown lists....try it in the address bar of your browser.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

    Nice one Ron. It works on a ComboBox on a UserForm as well

  8. #8
    Registered User
    Join Date
    03-17-2011
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

    beautiful trick! Love it!
    Last edited by shg; 03-20-2011 at 02:35 PM. Reason: deleted spurious quote

  9. #9
    Registered User
    Join Date
    11-16-2011
    Location
    San Diego, California
    MS-Off Ver
    2007
    Posts
    78

    Re: Neat Trick - Automatic Combo Box (Even Sorts And Removes Duplicates)

    This is a very cool trick and one that I think I can make great use of.

    Is their a way to reference this list in VBA?
    Can certain cells (header row etc) be ommitted from the referenced list?


    I currently have a userform with a listbox populated with unique cell values in a column.
    My one issue currently is it omits substring matches (so pay will be omitted if paycheck is in the column)

+ 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