+ Reply to Thread
Results 1 to 4 of 4

Combobox doesn't retain selected value when sorting ListFillRange

  1. #1
    Registered User
    Join Date
    07-17-2013
    Location
    Slovakia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Combobox doesn't retain selected value when sorting ListFillRange

    Hey,

    I'm using a Combobox (ActiveX) to select the values from a database, which is in another excel file. Since the database is gonna be frequently updated, is it possible to make the Combobox remember selected value, even when I sort the ListFillRange in the database file?

    For example, I have the first value selected in my Combobox, which starts on a letter "a", but when I sort the column of the database table from Z-A instead of A-Z, the selected value changes to something, which starts on a letter "z".

    Thanks for any advice!

    Lukas
    Last edited by LukasK; 07-17-2013 at 04:06 PM.

  2. #2
    Registered User
    Join Date
    07-17-2013
    Location
    Slovakia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Combobox doesn't retain selected value when sorting ListFillRange

    bump

    Thanks!

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Combobox doesn't retain selected value when sorting ListFillRange

    Lukas

    You need to store selection(s) somewhere and then reselect them after you've sorted.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    07-17-2013
    Location
    Slovakia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Combobox doesn't retain selected value when sorting ListFillRange

    Thanks Norie!

    I made a simple example, all in one worksheet. As you can see, two cells next to the combobox are using the vlookup function to show the values from the table, based on the combobox selection. I've also added this code to a worksheet, so when you add new items to the table, they are automaticaly visible in the combobox:

    Please Login or Register  to view this content.
    However, when you sort some of the table columns, the selection is changed.

    Could you please try to add your suggestion to this simple example, or at least give me some more information about it, so I can try it myself?

    Thanks a lot!

    Lukas
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Selected cell doesn't stay selected
    By minifreak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2012, 04:41 AM
  2. I need a ComboBox to return another Combobox if a specific answer is selected
    By concatch in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-22-2012, 03:43 AM
  3. Combobox: How to determine the location of the selected item if combobox has rowsource
    By ahsanzafar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2012, 03:24 PM
  4. [SOLVED] Remember ComboBox and ToggleButton values at exit
    By zbor in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-20-2012, 08:11 AM
  5. [SOLVED] Remember Selected Range
    By mpeplow in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2007, 03:29 PM

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