+ Reply to Thread
Results 1 to 3 of 3

Macro to Delete row if date criteria met?

  1. #1
    Registered User
    Join Date
    12-02-2011
    Location
    Maryland
    MS-Off Ver
    Excel 365
    Posts
    42

    Macro to Delete row if date criteria met?

    Hello
    Im using Excel 365

    I have a large spreadsheet with many rows and columns. Im attaching an abbreviated sample.
    In consideration of the number of rows in the actual, is there a way to delete a row if the date in Column D is PRIOR to 4/1/21?
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: Macro to Delete row if date criteria met?

    Instead of a Macro, use the built in Filter Function of Excel to filter out dates before your criteria.

    The Filter is located on the Data Tab of the Ribbon. You will of course need to convert your text dates to real dates in order for this to happen. With your dates as Text you will not be able to filter either in Native Excel nor with a Macro.
    Last edited by alansidman; 04-28-2023 at 12:16 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Macro to Delete row if date criteria met?

    I like Alan's approach, but if you want a macro:
    It does assume consistent structure in your D column though.

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

+ 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] Fast way to delete rows by date criteria
    By ghostly1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-14-2018, 05:31 AM
  2. Delete rows when criteria met in date and time
    By MicroTees in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-21-2015, 12:47 PM
  3. Macro to find Date Cells > Current Date and delete everything to left of that cell
    By LewisLonsdale in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2015, 06:36 AM
  4. Macro to delete certain rows if DATE criteria is met
    By lukasz_rz in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-28-2014, 11:30 AM
  5. Macro to delete certain rows if DATE criteria is met
    By lukasz_rz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2014, 01:16 PM
  6. Macro, autofilter, delete rows outside date range, defined names as criteria
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2011, 04:10 AM
  7. Cannot delete the duplicates on date criteria
    By kwik98 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2010, 02:58 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