Highlight entire row if date exceeded 3 days

coolman

New Member
Joined
Nov 21, 2017
Messages
36
Hi there

I am trying to use vba to check each cells in the column if the date has exceeded 3 days. If so the whole row will be highlighted red.

Here is my syntax

If Range("a:a").value < Range("a:a").value + 3 then

Range("a:a")EntireRow.Interior.ColorIndex = 8

End If

However I could not get the program to work. Are there anyone who can advice me on this?
 
Ok found another way to resolve the issue is using this syntax : If Range ("A"&i).Text = "" Then

I have another question is that if i want to highlight a specific range of cells such as cells in column b,c,d if the date has exceeded 3 days instead of entire row, could you advise me on what type of syntax I could use?

For this syntax line: If Range("A" & i).Value <> "" Then

It produce an error 440 message when i tried to run the program.

Is there any way to resolve the error?
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
For this syntax line: If Range("A" & i).Value <> "" Then

It produce an error 440 message when i tried to run the program.

Is there any way to resolve the error?

1) Have you made any modification to the above code?

2) Which version of Excel are you using ?

I tested it on office Excel 2016, no such error appears..

You must be missing some statement while copying the code..

Try this..
Just copy the code in a new module and run to see if it works.
 
Upvote 0
Im using excel 2011 mac

i have tested it on a blank module and still produce the same error message

1) Have you made any modification to the above code?

2) Which version of Excel are you using ?

I tested it on office Excel 2016, no such error appears..

You must be missing some statement while copying the code..

Try this..
Just copy the code in a new module and run to see if it works.
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,795
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top