+ Reply to Thread
Results 1 to 5 of 5

VBA Mark Row if Date in it older than..

  1. #1
    Registered User
    Join Date
    12-27-2016
    Location
    Switzerland
    MS-Off Ver
    2010, Office 365
    Posts
    26

    Question VBA Mark Row if Date in it older than..

    Hi, I found nothing in the internet, so I ask here.
    How can I mark all rows yellow in an excel file with dates older than for ex. 4 years in Column D?
    The code should only do that for rows, where "this" is in Column C. For example this:
    06-01-2017 11-17-39.png
    Hope someone can understand.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA Mark Row if Date in it older than..

    Have you checked out the Conditional Formatting functionality, using the 'Formula...' option and specifying something like

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However I'm puzzled by the rows you have marked since the dates aren't older than 4 years
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: VBA Mark Row if Date in it older than..

    Do you want to highlight the entire row if the Date in D column is 4 year greater than Today's date?
    why not use conditional formatting .

    If it is not the case please elaborate your question further.

    Best Regards
    Irman Bhatti
    Teach me Excel VBA

  4. #4
    Registered User
    Join Date
    12-27-2016
    Location
    Switzerland
    MS-Off Ver
    2010, Office 365
    Posts
    26

    Re: VBA Mark Row if Date in it older than..

    @excelisfun009
    Yes, but I want to use a VBA Code for this and I only want to consider the rows with "this" in row C. So basically it would be like this:

    that 2015
    this 2013
    this 2016
    that 2005
    this 2005

  5. #5
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: VBA Mark Row if Date in it older than..

    VBA version of Richards solution is here:

    Please Login or Register  to view this content.
    Best Regards
    Imran Bhatti
    Attached Files Attached Files
    Last edited by ImranBhatti; 01-06-2017 at 02:55 PM. Reason: Amendments in code

+ 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. Conditional Formatting: If a date is older than another date
    By JRose0303 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-15-2016, 07:00 PM
  2. sum units older then a date.
    By bone7890 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-09-2015, 05:35 PM
  3. Replies: 2
    Last Post: 04-23-2014, 09:07 AM
  4. Remove Row if Date is Older Than - Help!
    By aserle in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-25-2013, 02:09 AM
  5. [SOLVED] Date older than 3 years? (yes/no)
    By wintheranders in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-19-2013, 06:00 AM
  6. How to pull out an older date...
    By screenpath in forum Excel General
    Replies: 3
    Last Post: 11-14-2007, 07:37 AM
  7. [SOLVED] I want any date 90 days or older from current date change color
    By Big Abalone in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2006, 12:10 AM

Tags for this Thread

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