+ Reply to Thread
Results 1 to 2 of 2

Highlight Cells using Macro for Dates

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-15-2015
    Location
    Orlando, FL
    MS-Off Ver
    Office Standard 2016
    Posts
    266

    Highlight Cells using Macro for Dates

    Hi Everyone,

    Using an excel add in, I'm pulling in data from an internal database. I want to create some conditional formatting type features, but they have to be macros. When the data is refreshed, it creates new ranges and the conditional formatting becomes messy. Certain ranges are missing, etc.

    When I run the macro, it would check columns C4:C (Award Date) and D4:D (Start Date) for the following:

    - Orange Highlight: Date is within 15 days of Today's date.
    Example: Today is August 7, so anything within August 22 shown would highlight.
    - Yellow Highlight: If the start date (column D) is a date that occurs before the date listed in column C. So column D cannot be less than column C.
    - Blue Highlight: If the date range between the two is not greater than 30 days. So if D-C is not > 30 days, it would highlight. 7/1/18 to 8/1/18 would be no highlight.


    I can try to place with this if someone can get me started. If the different colors are problematic, then it can all be the same yellow highlight. I'm having a really hard time understanding how to highlight based off dates within VBA.

    Thanks for the help.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Highlight Cells using Macro for Dates

    You should be using conditional formats.

    Attach a sample workbook (not a picture or pasted copy). 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.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ 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] Want to highlight cells with expiry dates
    By Tony0731 in forum Excel General
    Replies: 3
    Last Post: 05-29-2018, 03:55 AM
  2. Highlight cells between 2 dates
    By mikehk in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-05-2017, 12:20 AM
  3. USing VBA to highlight cells between dates
    By cthamas222 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-16-2016, 08:25 AM
  4. [SOLVED] How do I highlight cells that do not contain valid dates.
    By AndyRoo119 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-09-2015, 09:04 AM
  5. [SOLVED] Highlight cells between two dates
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2015, 05:05 AM
  6. [SOLVED] Help with Macro to highlight cells between dates
    By Slomaro2000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-27-2015, 03:29 PM
  7. [SOLVED] Highlight Cells Based on Dates
    By pugsly8422 in forum Excel General
    Replies: 3
    Last Post: 01-27-2015, 01:09 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