+ Reply to Thread
Results 1 to 5 of 5

Deleting row based on date in particular column

  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    23

    Deleting row based on date in particular column

    Hi,

    I currently have rows of data with dates in column E.

    If the date is older than 6 months, I need the entire row to be deleted

    Here's the code i've been trying (with help from some other forums on here), but it just doesnt seem to work... any ideas would be greatly appreciated!

    Please Login or Register  to view this content.
    Have uploaded the worksheet if that helps....
    Attached Files Attached Files

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Deleting row based on date in particular column

    You are almost there..

    but the date is mentioned are in TEXT form, not in Date..
    Convert them in Proper Date format.. (Numeric) it will work..

    in the meantime try this..

    Please Login or Register  to view this content.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Registered User
    Join Date
    07-24-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Deleting row based on date in particular column

    Thankyou Debraj, that solved it!

    I note you've changed the icell3 range back to 12, which also seemed to be causing trouble when there was no data in the cell (i kept getting out of range issues)

    The problem is that there won't always be 12 rows... so I thought of this

    Please Login or Register  to view this content.
    but still getting range issues... any suggestions?

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Deleting row based on date in particular column

    its working for me.

    try this.

    Please Login or Register  to view this content.
    that 12 is just for testing purpose.. and this 65536 is also for testing purpose..
    you can use.. Rows.count also

  5. #5
    Registered User
    Join Date
    07-24-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Deleting row based on date in particular column

    Rows.count solved it! must've been some error with the blank cells.

    Thankyou!

+ 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. Macro: Deleting Rows based on date value
    By hreal34 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-31-2012, 02:08 PM
  2. Deleting Repeated Records based on date
    By jcowley in forum Excel General
    Replies: 3
    Last Post: 07-06-2010, 07:57 PM
  3. Deleting Rows based date validation
    By crapmind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2009, 05:17 PM
  4. Deleting a row based on date
    By F6Hawk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2008, 10:57 PM
  5. [SOLVED] Deleting a row based on a value in a column
    By Kai in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2005, 05:25 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