+ Reply to Thread
Results 1 to 6 of 6

VBA filter earlier than today

  1. #1
    Registered User
    Join Date
    07-25-2023
    Location
    Estonia
    MS-Off Ver
    2021
    Posts
    7

    VBA filter earlier than today

    Hello

    I'm trying to use VBA to filter out anything older than today and then delete it. I'm having trouble filtering values earlier than today, i need the criteria1 to be earlier than today, but not a fixed date.
    The code I am using is
    Please Login or Register  to view this content.
    Last edited by Prototype0680; 03-27-2024 at 02:30 AM.

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,386

    Re: VBA filter earlier than today

    This is how you only delete tablerows (not the whole row).
    It should fix your filtering problem too

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: VBA filter earlier than today

    Try

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-25-2023
    Location
    Estonia
    MS-Off Ver
    2021
    Posts
    7

    Re: VBA filter earlier than today

    Thanks, it helps and works, but I faced the next problem while using it. Criteria 1 date is in text format. Is there any way i can convert it to a date?
    Last edited by AliGW; 03-27-2024 at 02:32 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

  5. #5
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: VBA filter earlier than today

    Assuming the dates are like that in the original post, I would probably add a column to the table to convert the date and filter on that.

    Formula something like
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-25-2023
    Location
    Estonia
    MS-Off Ver
    2021
    Posts
    7

    Re: VBA filter earlier than today

    It kinda works. I just need to delete extra column i added. Thank you!
    Last edited by AliGW; 03-27-2024 at 02:31 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

+ 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. How to Add values from today's date and earlier
    By rwhaley97 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-06-2022, 09:06 AM
  2. Filter on today's date forward
    By Marcus Gee in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-13-2018, 07:36 AM
  3. [SOLVED] Filter today's birthday
    By mukeshbaviskar in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-26-2013, 12:29 AM
  4. Filter with criteria formula today
    By filnirv in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2012, 03:47 PM
  5. [SOLVED] filter by today's date
    By KAPearson in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 05-28-2012, 02:19 PM
  6. Change cell background to red if date=earlier than TODAY
    By johanna0507 in forum Excel General
    Replies: 3
    Last Post: 12-23-2011, 11:42 AM
  7. Count the number of dates in a range that are earlier than today.
    By DeborahS in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-08-2005, 10:06 PM

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