+ Reply to Thread
Results 1 to 11 of 11

Problem with date filter vba code

  1. #1
    Forum Contributor
    Join Date
    12-01-2022
    Location
    Rhodes,Greece
    MS-Off Ver
    office 2021
    Posts
    204

    Problem with date filter vba code

    In this workbook I want to filter the dates by the criteria I have put in cells i2 and j2.
    In the range from a1 until E315 I have my range,in the cells i2 and j2 I have my criteria range(start and end date) and in cell i6 is the destination that I want my filtered range to start.the cells i2 and j2 are connected with cells M2 and N2 because I have put and the bigger and smaller sign
    i don’t know why my code is not working..i have put and the criteria range correct and the range I want to filter ,as the destination range also.can you help me please?
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Problem with date filter vba code

    Criteria settings needs to be changed like attached.

    Header(s) in criteria must be identical to data range.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    12-01-2022
    Location
    Rhodes,Greece
    MS-Off Ver
    office 2021
    Posts
    204

    Re: Problem with date filter vba code

    Quote Originally Posted by jindon View Post
    Criteria settings needs to be changed like attached.

    Header(s) in criteria must be identical to data range.
    hallo from Greece and thank you very much for your response.is the a way in the cell M2 and N3 the format to be more readable?like this format 24/03/2023.even with helping columns

  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,913

    Re: Problem with date filter vba code

    You just need a few changes to your original workbook - see attached. Note: you should not have the start and end criteria on two separate rows as that is an OR criteria setup, not an AND.
    Attached Files Attached Files
    Rory

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Problem with date filter vba code

    Then use formula,

    Criteria in I2:J2.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    12-01-2022
    Location
    Rhodes,Greece
    MS-Off Ver
    office 2021
    Posts
    204

    Re: Problem with date filter vba code

    Quote Originally Posted by rorya View Post
    You just need a few changes to your original workbook - see attached. Note: you should not have the start and end criteria on two separate rows as that is an OR criteria setup, not an AND.
    Τhank you very much my friend.this is working perfectly.can you tell me please what modifications have you made?

  7. #7
    Forum Contributor
    Join Date
    12-01-2022
    Location
    Rhodes,Greece
    MS-Off Ver
    office 2021
    Posts
    204

    Re: Problem with date filter vba code

    Quote Originally Posted by jindon View Post
    Then use formula,

    Criteria in I2:J2.
    Please Login or Register  to view this content.
    this is working also perfectly.when you say [p2] you are referring to the cell p2?if yes why specific this cell ?
    thank you in advance

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Problem with date filter vba code

    Now criteria range is P1:P2.
    P1 needs to be blank and P2 should have formula resulting True/False for the 1st row of data.

  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,913

    Re: Problem with date filter vba code

    Quote Originally Posted by kvemperor View Post
    Τhank you very much my friend.this is working perfectly.can you tell me please what modifications have you made?
    I amended your criteria headers to match the original data column header.

  10. #10
    Forum Contributor
    Join Date
    12-01-2022
    Location
    Rhodes,Greece
    MS-Off Ver
    office 2021
    Posts
    204

    Re: Problem with date filter vba code

    Quote Originally Posted by rorya View Post
    I amended your criteria headers to match the original data column header.
    Thank you very much my friend for all the effort you made for me and the explanation

  11. #11
    Forum Contributor
    Join Date
    12-01-2022
    Location
    Rhodes,Greece
    MS-Off Ver
    office 2021
    Posts
    204

    Re: Problem with date filter vba code

    Quote Originally Posted by rorya View Post
    I amended your criteria headers to match the original data column header.
    thank you very much for the explanation and you r effort.this is first time i see that.i believe is more advanced for my knowledge.

+ 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] Date filter problem
    By Peterino in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 11-05-2021, 07:47 AM
  2. Replies: 2
    Last Post: 04-24-2020, 04:56 AM
  3. Date Filter Problem
    By zack65 in forum Excel General
    Replies: 11
    Last Post: 03-05-2018, 04:45 AM
  4. Advanced filter by date range, international date format problem
    By Senator685 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2013, 08:16 AM
  5. Date filter problem
    By Martin9 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2012, 05:10 AM
  6. Date Filter problem
    By markee in forum Excel General
    Replies: 0
    Last Post: 06-15-2011, 06:47 AM
  7. Advanced filter date problem
    By pdmkh in forum Excel General
    Replies: 14
    Last Post: 01-18-2011, 04:55 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