Results 1 to 4 of 4

Thread: Filter data based on combobox value problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    157

    Filter data based on combobox value problem

    I have 2 comboboxes that search a number of worksheets and add the filtered results to a named sheet. I have attached a working example of my file.

    My problem is that I cannot get my second search for date to work. With my location search, the names are added to the combobox by code as they remain constant. The problem with the second combobox is I need to add the dates to the list and then be able to select a particular date resulting in a filtered sheet just like my location search.

    1. I click on my combobox1 which runs the code to merge data from all worksheets begining with letter "D"

    2. It then populates combobox1 with the dates in column "I" of my merged worksheet ("MasterSheet").

    3. I can select a date from my list and it then creates a view based on the date selected.

    I just cant get the dates to display in my combobox, can anyone spot what I am doing wrong?

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Filter data based on combobox value problem

    Can you post the code where you fill the combo with dates?
    Are you using two columns on the combo - one hidden?
    Convert the dates to text? (format function)

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    157

    Re: Filter data based on combobox value problem

    Ecniv,

    I am just trying to use:

    Dim myDateRange As Range
    UserForm1.ComboBox1.Value = myDateRange

    I defined the range using the insert/define bit on the menu bar.

    I dont have a hidden column, at least not deliberately, and the date is currently formatted as: dd/mm/yyyy. Does any of that mean anything?

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Filter data based on combobox value problem

    Quote Originally Posted by New2This
    Ecniv,

    I am just trying to use:
    Code:
    Dim myDateRange As Range
    UserForm1.ComboBox1.Value = myDateRange
    I defined the range using the insert/define bit on the menu bar.

    I dont have a hidden column, at least not deliberately, and the date is currently formatted as: dd/mm/yyyy. Does any of that mean anything?
    I have not seen a combo box filled like that... always a first time.
    When I do this I usually loop thorugh and add the data to the combo box using additem (or .add). If you read up on these and see if they help...

    Once you have a combo box of dates, and you select one, you need to put it somewhere on a sheet so your formulas etc can use it to show the data on a filtered sheet.

    I have see this done, but it escapes me how. I think is is if, vlookup and conditional formatting combined creatively.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width