+ Reply to Thread
Results 1 to 11 of 11

Filters mess up comboboxes

  1. #1
    Registered User
    Join Date
    10-20-2009
    Location
    Rome
    MS-Off Ver
    Excel 2003
    Posts
    7

    Filters mess up comboboxes

    I have 2 problems regarding the autofilter function and comboboxes.

    I have an excel database with comboboxes. I want to be able to filter the data, therefore I am using the autofilter function.

    1) When I filter, the comboboxes above a data section that is to be viewed end up at the first row, and comboboxes below end up in the first row following the viewed data set. Is there any way in which I can hide comboboxes when their rows are hidden? Today I use the form comboboxes, but I can use the control toolbox ones if necessary. Also, I can use some other function than the autofilter function if necessary.

    2) Is there any way to make the filter function take information in comboboxes into account as well? For example, if I filter by weight and one option is available in three different weightes (displayed in a combobox) I still want that to be seen following filtering (can I perhaps write information in the cell under the comboboxes? If so, can the filter function take several data in the same cell into account?).

    I have Excel 2002.

    Thank you very much!

  2. #2
    Registered User
    Join Date
    10-20-2009
    Location
    Rome
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Filters mess up comboboxes

    On problem 1 I am now thinking about making a first row which is always viewed, where it doesn't matter if all comboboxes end up following the filter. Is it possible to lock one row, e.g. so it is not affected by the autofilter function?

    Next step would be to hide it, but then the combo boxes seem to end up in the "last viewable row", is there some way to fix this?

    Or maybe another solution would be preferable...

  3. #3
    Registered User
    Join Date
    10-20-2009
    Location
    Rome
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Filters mess up comboboxes

    I still haven't solved the problem.

    I am happy to give further information and explanation of the problem if needed in order to help me.

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Filters mess up comboboxes

    Hi Engwar,

    If the below doesn't help enough, can you please upload a sample file with the correct layout & your existing code?

    No promises, because I'm not very clear on what you need (w/o a sample file) but you could try...
    1) Remove the Autofilter, select the range that you want to be affected by the Autofilter (not just the header row), & reapply the Autofilter.
    Have a look at all the pages relating to Excel's Advanced Filter functionality on Debra's site: http://www.contextures.com/xladvfilter01.html

    2)
    (can I perhaps write information in the cell under the comboboxes? If so, can the filter function take several data in the same cell into account?).
    It's hard to say anything without seeing a file showing your existing comboboxes & the layout...
    However, I suggest having your comboboxes at the top of the page as part of the header rows (ie above the data & with Freeze Panes being used). Do the Advanced Filter explanations (see above link) help?
    AFAIK, normal filter functions can not "take several data in the same cell into account". It could be done using macros which use the VBA Split function - but let's stay away from that approach for the moment.

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  5. #5
    Registered User
    Join Date
    10-20-2009
    Location
    Rome
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Filters mess up comboboxes

    Thank you Rob. I will upload two samples in order to explain my problem better.

    The first file (database) illustrates what I would like it to look like. But now, if you filter you will see the combo boxes end up in funny places.

    I will only have to be able to filter according to the white columns (even though it would be even better to be able to filter according to all categories). Ideally I would like the filter to recognize the data in the combo boxes, but I can avoid this by making differences row for for each alternative. However it is not possible to do this for all yellow columns as well (and thus avoid the combo box problem alltogether)as the original database include hundreds of combo box alternatives, which make tens of thousands different combinations possible. Here I have used the forms combo boxes.


    In my second file (database(draft)) there is another kind of combo box that actually fixes the problem (as it works fine with the filter function). However, I don't know what kind of combo box this is, as I got the document it was already applied, and I can't alter the combo box in any way, not in design mode in control toolbox either (and no the document is not protected). Do any of you know what kind of combo box this may be?

    Note that I've now upgraded to Excel 2003.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-20-2009
    Location
    Rome
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Filters mess up comboboxes

    I finally found out it is a validation data list (in database (draft)), and not a combo box. Now I should be able to change all combo boxes to validation data lists, and then the messed up combo box problem is fixed.

    As data validation lists seems better fit for the autofilter function, do anyone know if it's actually possible to include all options in a data validation list in the filter critera (before choosing an option)?

  7. #7
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Filters mess up comboboxes

    hi Engwar,

    do anyone know if it's actually possible to include all options in a data validation list in the filter critera (before choosing an option)?
    I don't understand, can you please try asking your question in a different way?
    I'll try though...
    When you say "filter criteria" do you mean in the dropdown list that appears when you click on the arrow that shows on a column that has the Autofilter turned on?
    If so, it defeats the aim of the Autofilter (ie to show the list of items that are in that column of the Autofilter range).

    btw, where you are using "input ranges" for comboboxes or "Source" for Data validation, it makes it much easier to maintain the file if you give the ranges Meaningful headers/titles. Also, I suggest keeping separate lists for the validation in separate columns as it allows for variations to be added as necessary.

    hth
    Rob

  8. #8
    Registered User
    Join Date
    10-20-2009
    Location
    Rome
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Filters mess up comboboxes

    Rob: Thanks for the input. I will start to think about the headlines in the raw data as well, as in the original document it is actually a mess right now.

    "do anyone know if it's actually possible to include all options in a data validation list in the filter critera (before choosing an option)? "

    With this I mean that if I have a data validation list in a cell, for example consisting of the data "A", "B" and "C". Then when I filter the column according to "A" I would like to view the row with a data validation list where "A" is one of the alternatives even though "A" is not chosen (i.e. I would like to hide all rows where the A option is not available).

    Am I more clear now?

  9. #9
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Filters mess up comboboxes

    hi Engwar
    I'm sorry I still don't understand your intent...
    Can any other helpers make suggestions?
    Anyone...?

    I'll keep trying though. Can you please upload the latest version of your file with a set of sheets that manually show us what you hope to achieve (+ step by step explanations)?

    would like to view the row with a data validation list where "A" is one of the alternatives... hide all rows where the A option is not available).
    Do you have different data validation settings for different cells in the same column?
    (ie some cells offer "A","B","C" with some offering "B","C","D")
    If this is the case, it's not an ideal spreadsheet design. Can you think of a way of redesigning the spreadsheet so the same data validation is used in all rows of the specific column for consistency?
    To identify cells that have the same data validation settings, select a cell with validation, press [F5], press [Special], then choose "Data Validation" - "Same" (or "All") & [Ok].
    ...one of the alternatives even though "A" is not chosen...
    Do you mean the cell value is something else (ie "B" or "C")?
    Or is the cell blank?
    ...when I filter the column according to "A"...
    Filtered data using Excel's Autofilter displays only the rows that have a displayed* cell value which meet criteria that you specify and hides rows that you do not want displayed.
    *Some slightly more technical explanations are needed when discussing how dates are filtered.


    Rob

  10. #10
    Registered User
    Join Date
    10-20-2009
    Location
    Rome
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Filters mess up comboboxes

    Yes I do have different data validation settings for cells in the same column. I will explain why it has to be this way:

    Let's say the database is about different car possibilities. In the column "colour", different options are available for different cars, for example a Mercedes may be available in black, white and red, and a Ford is available in white and blue. I want the data validation list to display only possible colour options for a certain car.

    Ideally I would like to be able to filter according to colour, for example if I choose that all cars available in red should be displayed, I would like to display all cars where red is available among the options in the data validation list. But I understand this might actually be impossible to do when using data validation lists.

    Now I have solved the problem by making unique rows for all options in the most important columns, such as for the axle configuration (i.e. Ford 4x2 and Ford 4x4 has different rows). Thus data validation lists are avoided in these columns, and filtering is not a problem.

    For now I am happy only to be able to filter a these few columns. But thank you for all your help!

    I will still watch this thread, so if you feel like coming up with any solution enabling filtering of columns with data validation lists as well, please post your solution here.

  11. #11
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Filters mess up comboboxes

    Ahhh, now I understand
    To get some more information which may help you try searching for "cascading dropdowns excel validation" (eg http://www.google.co.nz/#hl=en&sourc...a026280b90e882)
    One that may be of interest & has some good links at the base of the page is Tushar's http://www.tushar-mehta.com/excel/ne...wns/index.html or Ed's video (I haven't watched it): http://communityclips.officelabs.com...e-eb0b1a27a29f

    Quote Originally Posted by engwar View Post
    ...Ideally I would like to be able to filter according to colour, for example if I choose that all cars available in red should be displayed, I would like to display all cars where red is available among the options in the data validation list. But I understand this might actually be impossible to do when using data validation lists.
    ...
    Let's not say "it's impossible" but it would be difficult - maybe a different approach would be better. I suggest either creating a separate helper column which uses TRUE/FALSE to identify if the row should be visible. Or, in fact, Advanced Filter may be a better option because, although it is harder to set up, it is "Advanced" (see http://www.contextures.com/xladvfilter01.html).

    Quote Originally Posted by engwar View Post
    ...I will still watch this thread, so if you feel like coming up with any solution enabling filtering of columns with data validation lists as well, please post your solution here.
    If you want further help I strongly recommend attaching your most recent file that shows your actual layout & provides context for helpers.

    hth
    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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