+ Reply to Thread
Results 1 to 8 of 8

Delete dates not within a date range

  1. #1
    Registered User
    Join Date
    12-07-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    13

    Question Delete dates not within a date range

    Need to delete the dates before a start date
    Need to delete the dates after a end date
    Need help modifying the code below.

    Start Date
    8/14/2013
    8/23/2013
    8/23/2013
    8/23/2013
    9/1/2013
    9/1/2013
    9/5/2013
    9/13/2013
    9/20/2013
    9/24/2013
    9/29/2013

    Please Login or Register  to view this content.

    The "Test program Equipment Planner2.xls" transfer data from "PMData.xls"
    Attached Files Attached Files
    Last edited by alansidman; 11-11-2013 at 09:58 PM. Reason: code tags added

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Delete dates not within a date range

    Maybe
    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Delete dates not within a date range

    Hello,

    Try this code :
    Please Login or Register  to view this content.

    Reminder : As per forum rules. Please use code tags to make your code visible.
    Last edited by alansidman; 11-11-2013 at 09:55 PM.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Delete dates not within a date range

    Yet one more:

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  5. #5
    Registered User
    Join Date
    12-07-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Delete dates not within a date range

    Thank you AlphaFrog

    When I run the I get a "runtime error 1004" at this line

    Please Login or Register  to view this content.
    I have attach my files to this thread.
    Last edited by alansidman; 11-11-2013 at 09:57 PM.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Delete dates not within a date range

    @BowHunter09

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added them for you this time. Please read all the forum rules and observe them in the future.)
    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

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Delete dates not within a date range

    Quote Originally Posted by BowHunter09 View Post
    Thank you AlphaFrog

    When I run the I get a "runtime error 1004" at this line

    Please Login or Register  to view this content.
    I have attach my files to this thread.
    Try this...

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 11-12-2013 at 12:14 AM.

  8. #8
    Registered User
    Join Date
    12-07-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Delete dates not within a date range

    Thank you very much, it works.

+ 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. Popup box asking the effective date, so macro can delete any dates < entered date.
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2013, 07:40 AM
  2. Date filter, find listed dates and delete whole row
    By zit1343 in forum Excel General
    Replies: 3
    Last Post: 04-25-2012, 08:16 PM
  3. Macro to delete dates > xx date
    By koltregaskes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2011, 10:35 AM
  4. Replies: 8
    Last Post: 02-27-2009, 06:06 PM
  5. Replies: 25
    Last Post: 09-07-2005, 12:05 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