+ Reply to Thread
Results 1 to 8 of 8

ComboBox with Filtered Date Range

  1. #1
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    ComboBox with Filtered Date Range

    I have a UserForm (frmExisting) with a ComboBox (cmbJobs) that is initialized with values from column A in dynamic range “Job_No”. There is a date in each row in column H.
    I wish to add two option buttons (optWeek and optMonth) to the form so that after opening the form (in which the combobox shows a long list of numbers) and selecting an option, the list is reduced to either all the numbers with dates within the last week or the last month.
    Any help with the code would be appreciated, thanks Sandy.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: ComboBox with Filtered Date Range

    I did something similar in another form.
    https://chandoo.org/forum/threads/gr...6/#post-219480

    But it uses Windows specific library as mentioned in the thread.

    Is there Mac users who will be using this?

    Please upload sample file of what you currently have, without it, it's difficult to give you specific code that does what you are looking for.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: ComboBox with Filtered Date Range

    File attached
    Attached Files Attached Files

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: ComboBox with Filtered Date Range

    Few Questions:

    1. Should the combobox be filled with entire data if neither options are selected?
    2. What day of week does your week start? Monday/Sunday?
    3. Last Month & Last Week is always in context of current date? Or the Month/Week last data in the range falls in?

    I'm headed out for the night, but will check back tomorrow.

  5. #5
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: ComboBox with Filtered Date Range

    Have a nice evening CK76, its 10.30am Friday over here.

    1. Should the combobox be filled with entire data if neither options are selected? YES
    2. What day of week does your week start? Monday/Sunday? SUNDAY
    3. Last Month & Last Week is always in context of current date? Or the Month/Week last data in the range falls in? CONTEXT WITH CURRENT DATE.

  6. #6
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: ComboBox with Filtered Date Range

    I have had more thoughts on what I am trying achieve:
    Default Option - Full List
    Option 1 - 7 days previous to current date.
    Option 2 - 30 days previous to current date.
    Option 3 (if not too difficult) - Select Month and Year i.e December 2017.

  7. #7
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: ComboBox with Filtered Date Range

    I Change the properties of the combobox
    columnscount to 8
    columnswidth in properties
    No RowSource in properties

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: ComboBox with Filtered Date Range

    Thanks Leo that worked just as I wanted it to. I may just tweak it a little so that the month and year are selected from a listbox.
    Cheers Sandy

+ 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] Do a vlookup with a combobox on a datepicker's date with a range
    By JohnGreen2 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 11-17-2017, 07:08 AM
  2. Replies: 3
    Last Post: 05-07-2017, 02:53 PM
  3. Combobox filtered with textbox; Listview filtered by combobox
    By Arvin.Amaro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-02-2015, 11:48 AM
  4. [SOLVED] Excel VBA - Issue in Naming Filtered Range on a Filtered List.
    By Vinod Krishna.C in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2014, 01:17 PM
  5. Form ComboBox to Filter date range by Month
    By BlankPage in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2012, 09:09 AM
  6. Lookup Value in Filtered Date Range
    By excelformula in forum Excel General
    Replies: 17
    Last Post: 01-28-2009, 07:01 PM
  7. Max date in auto-filtered range
    By mark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2005, 12:05 AM

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