+ Reply to Thread
Results 1 to 6 of 6

If hire date (column D) is greater than revision date (column F) then delete row

  1. #1
    Registered User
    Join Date
    04-15-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    26

    If hire date (column D) is greater than revision date (column F) then delete row

    Hi
    I am just getting into VBA and macros. The spread sheet i am working on is full of macros, which I cannot believe how much time it actually saves.

    This workbook I am working on is a one time use so doing things doesn't have to be as clean as a sustaining worksheet.

    All that I am trying to do is check to see if column D greater than column F and if so delete the row.

    What would be awesome if the row is moved to a different sheet.

    I appreciate the knowledge sharing and your time.

    Scott
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-15-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: If hire date (column D) is greater than revision date (column F) then delete row

    the actual file has 1368 rows of data, not sure if that matters.

    thank you

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: If hire date (column D) is greater than revision date (column F) then delete row

    In your actual workbook is column D and F formatted as a date or is it formatted as general (as in your example workbook). It makes a difference.

  4. #4
    Registered User
    Join Date
    04-15-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: If hire date (column D) is greater than revision date (column F) then delete row

    I can format both columns as either. the real sheet is formatted as date. If general is easier I can format as such.
    thank you
    Scott

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: If hire date (column D) is greater than revision date (column F) then delete row

    The problem with how it is now is that it is not in a proper format which excel can recognize to compare if one date is past another. Is the real sheet formatted as a proper date? In other words, is it still Jun/25/2013 but has had "date" chosen for it as the format type.
    Last edited by stnkynts; 05-14-2013 at 07:11 PM.

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: If hire date (column D) is greater than revision date (column F) then delete row

    Here is a way around it, assuming your hand typed in month is 3 characters long and your day/year is 2 and 4 characters respectively. Note the possible need to change the sheet name in code:

    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)

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