+ Reply to Thread
Results 1 to 5 of 5

How to get dates list from list object filter

  1. #1
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    How to get dates list from list object filter

    Hi all,

    I got an excel table (list object) with at least one of its columns being a Date field. the user manually applies multiple filters/criteria in various columns. i am trying to get the text of all filters/criterias the user entered. So if no date filter is applied the following code works fine.

    Please Login or Register  to view this content.

    The moment the user applies a filter on a date field i get app defined or object defined error.

    This is how fl looks like in watch window when in fact i have applied 3 criterias in both filters the second of wich is a date field:

    fl.png

    Any ideas??

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: How to get dates list from list object filter

    Hi, I believe this is a "bug" or at least a known-issue where date filters are applied on date fields with "date grouping" enabled

    the below links outlines an XML type approach but I won't pretend to have looked at it in any detail

    https://stackoverflow.com/questions/...62115#32062115

    so, as I say, if you need this (and above approach not viable) you would need to consider disabling the date grouping feature in the first instance (i.e. pre-filtering):

    Please Login or Register  to view this content.
    at which point you should find you can pick up the filtered dates...

    of course with the 2nd option there is a pretty notable downside to that for an end-user pending volume / disparity of dates at source.

  3. #3
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: How to get dates list from list object filter

    Hi, yes this seems to work around the problem.
    However, it is strange as without disabling grouping, if i try to do the same thing with programatically setting the filter criteria in plain data (no list object) this looks to work (?):

    Please Login or Register  to view this content.

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: How to get dates list from list object filter

    I think assigning the values (as explicit serials) versus reading the values in a "grouped" date field is a different thing, regardless of whether or not a Table is being used
    i.e. if you revised your initial code to work on the above range object it would still fail, and for the same reason.

    I'll ask others to have a look at this as there are plenty of smarter XL folk than me who may know of a 'workaround' aside those already noted in my earlier post.

    edit:
    On a final aside, just in case it helps, with default Grouping behaviour still enabled, if the Date Filter option is used to filter (as opposed to the tree view) you can still read the criteria
    if pre-set options are used you would need to 'translate' them to respective date values, but if custom date filter is applied you can read the serials.
    Last edited by XLent; 10-28-2019 at 05:23 AM.

  5. #5
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: How to get dates list from list object filter

    ok got you. anyone knows if this is fixed post office 2016? i will test the alternative you give and see how it works. i got a feeling tho that the first workaround will work better. any way thx!

+ 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. Formula to filter out the year based on a list of dates
    By hassanm in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-12-2017, 03:34 AM
  2. [SOLVED] VBA Code: Copy paste from list object to other list object based on criteria
    By Ratu in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-21-2017, 10:05 PM
  3. [SOLVED] Filter dates rows using a drop down list
    By DJDRU in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-21-2015, 06:59 PM
  4. Trying to make a filter list based on dates
    By siukingyiu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 01:40 PM
  5. filter list on new sheet based on due dates
    By AdamK in forum Excel General
    Replies: 2
    Last Post: 09-15-2010, 04:53 PM
  6. filter list of dates using VBA
    By nachousa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2010, 05:24 PM
  7. [SOLVED] FILTER OUT DATES IN LIST
    By Lisa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-31-2005, 11:06 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