+ Reply to Thread
Results 1 to 12 of 12

Delete Rows based on date

  1. #1
    Registered User
    Join Date
    03-19-2018
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    27

    Delete Rows based on date

    Hi All
    Hoping you can help ....once again!

    I have dates in column C in a daily report I run. After I sort by date I need to delete all rows that are 1 and 2 days prior. I cannot figure out how to do this through VBA.

    Example:
    If I run today's report (on 04/12/2018) I need to delete dates 04/11/2018 and 04/10/2018.

    tomorrow it will be different.

    I also need workdays only Monday - Friday

    Can anyone direct me?

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Delete Rows based on date

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.



    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.


    *Will there be 3 days prior - why not all prior dates??
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    03-19-2018
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    27

    Re: Delete Rows based on date

    Yes - Yes, 3 days prior and all prior dates. I just don't want to see last two business days so I need those deleted.

    see attached template
    Attached Files Attached Files

  4. #4
    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: Delete Rows based on date

    Please Login or Register  to view this content.
    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

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Delete Rows based on date

    Another to try:

    Please Login or Register  to view this content.
    Last edited by xladept; 04-12-2018 at 04:11 PM. Reason: Detail

  6. #6
    Registered User
    Join Date
    03-19-2018
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    27

    Re: Delete Rows based on date

    Thanks - this worked PERFECT!! I would have NEVER gotten this on my own! Genius.

  7. #7
    Registered User
    Join Date
    03-19-2018
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    27

    Re: Delete Rows based on date

    Thanks - this worked PERFECT!! I would have NEVER gotten this on my own! Genius.
    Quote Originally Posted by alansidman View Post
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-19-2018
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    27

    Re: Delete Rows based on date

    this didn't quite do what I needed it to do. I still could have never gotten this far tho... thanks for trying!

    Quote Originally Posted by xladept View Post
    Another to try:

    Please Login or Register  to view this content.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Delete Rows based on date

    You're welcome - what didn't it do?

  10. #10
    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: Delete Rows based on date

    Thanks for the Rep. If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Registered User
    Join Date
    03-19-2018
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    27
    Quote Originally Posted by xladept View Post
    You're welcome - what didn't it do?
    It was deleting the header row.

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Delete Rows based on date

    Oops!:

    Please Login or Register  to view this content.

+ 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] Delete Rows Based on Date
    By joshag in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2017, 03:39 PM
  2. [SOLVED] Vba to select rows based on date and Delete
    By Wither125 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-03-2016, 11:48 AM
  3. VBA to delete rows based on date
    By BillDoor in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-21-2015, 10:28 AM
  4. [SOLVED] Delete rows based on date range
    By hommeg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2015, 04:59 PM
  5. Delete rows based on date
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-09-2009, 01:44 AM
  6. Delete rows based on date
    By mattbrem in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-06-2009, 12:22 PM
  7. Delete Rows based on date range.
    By ge0rge in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-13-2009, 10:52 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