Conditional Formatting

frustrated_macro

New Member
Joined
Sep 4, 2019
Messages
39
Office Version
  1. 365
Platform
  1. Windows
Hi
I have dates in two diff columns, and need to highlight when the date in J is bigger than the one in D, of that same row
And i can get the conditional formatting to work on that one row, but how do i apply it to allll rows of the document, so that its alwasys looking at the matching row
so like J22 and D22 are compared and not D22 vs J12
The second picture is whats happening when i try to apply it to the whole column

1710336058607.png
1710336097598.png
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
What formula are you using?
 
Upvote 0
Select JUST the range you want to apply the Conditional Formatting to, i.e. J3:J100 or whatever row you want to go down to.

Then, write the Conditional Formatting formula as it applies to the FIRST cell in that range, and it will adjust it for the others, i.e.
Excel Formula:
=AND(J3>D3,J3>0,D3>0)
and choose your desired formatting option.
 
Upvote 0
Solution
Select JUST the range you want to apply the Conditional Formatting to, i.e. J3:J100 or whatever row you want to go down to.

Then, write the Conditional Formatting formula as it applies to the FIRST cell in that range, and it will adjust it for the others, i.e.
Excel Formula:
=AND(J3>D3,J3>0,D3>0)
and choose your desired formatting option.
perfect! thank you lots!
 
Upvote 0
You are welcome.
Glad we were able to help!
 
Upvote 0
okay, new issue
i need to create a macro that basically does this kind of conditional formatting

1711118227441.png



the range will be G2:G & LAstRow, which has already been defined, the range in the screenshot was just me testing that all the colors worked
but i have no idea how to write that into the macro. i had a very sad attempt at an IF loop, but im not sure how to properly write the formula AND the formatting into the loop.
 
Upvote 0
okay, new issue
i need to create a macro that basically does this kind of conditional formatting

View attachment 108834


the range will be G2:G & LAstRow, which has already been defined, the range in the screenshot was just me testing that all the colors worked
but i have no idea how to write that into the macro. i had a very sad attempt at an IF loop, but im not sure how to properly write the formula AND the formatting into the loop.
As that is an entirely new question with new requirements (looking for VBA code instead of Conditional Formatting), you should post it to a brand new question so it appears in the "Unanswered threads" listing.
 
Upvote 0

Forum statistics

Threads
1,215,077
Messages
6,122,991
Members
449,094
Latest member
masterms

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