+ Reply to Thread
Results 1 to 19 of 19

Advanced Filter Dates Help

  1. #1
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Advanced Filter Dates Help

    Hello All,

    I am having trouble with my advanced filter. Here is my code
    Please Login or Register  to view this content.
    Just to give more information.
    On Sheet 1 is my data that I am filtering. The header starts at B8.
    My criteria is on Sheet 3. Header of the criteria starts on H5
    I am filtering by dates. The dates are on the same line to create an And statement.
    This is getting copied to a new area and the headers match the original data.

    However nothing is coming over and I am beyond clueless

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,901

    Re: Advanced Filter Dates Help

    Is row 7 on Sheet1 completely empty?
    Rory

  3. #3
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    Hello,
    Yes on Sheet1 Row 7 is completely empty.

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,901

    Re: Advanced Filter Dates Help

    Then I need to see the workbook please as the code looks fine to me.

  5. #5
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    Ok going to get a file to upload

  6. #6
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    It says I cannot post links

  7. #7
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    Oh the rules say I post 10 times then I can, Let me try now, Sorry

  8. #8
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    @rorya here is the link Https://ufile.Io/hxb9b
    Im working off of the data sheet and sheet 2.
    File may come up as protected, go into vba under employee and run the unprotect code first.

    In module 3 is where I have the code stored for this part.
    I did change it up and am now resulting to a customer filter to get this to work. However, It is working but it is not pulling the dates correctly.
    Right now it has 1/1/2018 - 1/1/2019 and its only pulling one item for 8/10/2019 which is not in that range.
    The 4 codes that I am running are showall, showallrecords, copyfilter, between2dates.

    Any help would be appreciated.

  9. #9
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,901

    Re: Advanced Filter Dates Help

    I'm confused. The workbook you posted doesn't have your advanced filter code in it anywhere, nor does it even have the Sheet3 referred to in that code. Makes it a little hard to debug!

  10. #10
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    You are correct, Where I posted the link I said I got rid of the advanced filter and went onto a custom filter. Open up module 3 in the code and look at showall, showallrecords, copyfilter, and between2dates. This one is actually running and will pull. But the data it is pulling is not getting filtered correctly.

    Could you please look at it.
    I scrapped the original one that I posted in the beginning of the thread and tried this one

  11. #11
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,901

    Re: Advanced Filter Dates Help

    The last three dates on your data sheet are actually text, which is part of the problem; your filter should be set on row 8 not row 9; and you should be using dates not strings for the filter. Try this one:

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    Hello,

    So when I go to my data sheet and click on the date - Format cells, it is showing that it set to date format. Maybe I misunderstood what you meant there.
    I plugged in your new code in place of the one I was using, but now it will not pull any information over.

    I do really appreciate you helping because I am lost at the moment on this

  13. #13
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,901

    Re: Advanced Filter Dates Help

    F8:F10 are all left-aligned for me (after removing the manual right-alignment on F8), which indicates that they are stored as text. After re-entering them as proper dates, the code works perfectly for me with your workbook.

  14. #14
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    Sorry to be such a noob here. I went to data and removed any right alignment that was there, Went to my filtering sheet and made sure no right alignment was there as well. Still nothing.

    Could you break down the steps that I need to take. or reupload the copy of the book you have so that I can see it that way.

    Please and thank you

  15. #15
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,901

    Re: Advanced Filter Dates Help

    Here's my amended copy.
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    you are a genius, not sure what you changed but it works!

    I have one last question for you if you have the time

    Right now it says frequency in the middle, I want to change this to be completion date and have it only pull data in the specified time range that has nothing for a completion date.

    Essentially I am trying to see work that is due that has not been completed yet.

    If you have time would you be able to assist in this as well.

  17. #17
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,901

    Re: Advanced Filter Dates Help

    You should just need to add another line below the existing autofilter line:

    Please Login or Register  to view this content.
    The code doesn't care what E2 says as a title.

  18. #18
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    One last thing sorrrrrrry. When I add in a new line to my data it does not pull whatever new I put in. I think this has to do with whatever you changed initially to make it see it. Could you please go into the steps you took with the alignment ect so going forward I can fix this.

    Adding the new line worked for the Completion date BTW

    Correction::: I kinda figured out to problem, and I can fix it with text-to-column, but in the long run that is not going to work for me. Could you please look at the code I have here and tell me how to change it accordingly.
    Please Login or Register  to view this content.
    Specifically this line
    Please Login or Register  to view this content.

    So that it can be properly formatted as a date instead of text
    Last edited by nathan.volker12; 08-16-2018 at 12:45 PM.

  19. #19
    Registered User
    Join Date
    08-13-2018
    Location
    taylor mill, kentucky
    MS-Off Ver
    2010
    Posts
    61

    Re: Advanced Filter Dates Help

    I figured it out thank you so much for your help

+ 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. Advanced Filter with dates
    By etaver87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2016, 04:23 PM
  2. Advanced Filter between two formatted Dates
    By Mamud in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-29-2016, 06:24 PM
  3. Advanced filter vba with dates
    By lafleuk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-26-2016, 01:21 PM
  4. [SOLVED] Advanced Filter - 2 Dates
    By jennyaccord in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2012, 10:02 AM
  5. Advanced filter - dates ascending
    By Xx7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2011, 05:01 AM
  6. Advanced Filter with dates and times
    By kt1978 in forum Excel General
    Replies: 3
    Last Post: 01-31-2011, 05:54 AM
  7. Advanced filter using dates
    By Rusty in forum Excel General
    Replies: 2
    Last Post: 03-09-2006, 12:25 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