Forum Discussion

JohnD1954's avatar
JohnD1954
Copper Contributor
May 14, 2022
Solved

create VBA function to highlight dates

I have a spreadsheet that needs to have a date function inserted. Our business has to do reports for clients on a regular basis and I need to highlight upcoming report dates for specific clients. I'm...
  • HansVogelaar's avatar
    HansVogelaar
    May 14, 2022

    JohnD1954 

    It shouldn't be difficult to do that using conditional formatting.

    Select the entire range with the dates that you want to highlight.

     

    On the Home tab of the ribbon, select Conditional Formatting > New Rule...

    Select 'Format only cells that contain'.

    Leave the first drop-down set to 'Cell Value'.

    Select 'equal to' from the second drop-down.

    Enter the formula =TODAY()+30 in the box next to it.

    Click Format...

    Activate the Fill tab.

    Select a color, for example yellow.

    Click OK, then click OK again.

     

    Repeat the above steps, but with 'less than' instead of 'equal to'.

    Use the same formula =TODAY()+30 and select a different color, for example orange.

     

    Finally, repeat them again, with 'less than'.

    Use the formula =TODAY() and select yet another color, for example red.

Resources