VBA Conditional Format Column to the Left Continuously

cjvenables

Board Regular
Joined
Aug 2, 2011
Messages
65
Hello,

Looking for some conditional formatting code that will let me look to see if the values in column B are greater than, less than, or equal to the values in column A. Then, I'd like column C to do the exact same thing with column B, and so on.

The column rows can be dynamic
Less than column is green
Equal to is no fill
Greater than is red

Thanks!
 

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

BigC

Well-known Member
Joined
Aug 4, 2002
Messages
851
You don't need VBA for this - basic CF formula will do the trick.
Select the entire range of cells to be Conditionally formatted and then create/apply the CF rule as if it only applied to the active cell (just ensure that you do NOT include a $ to anchor the column reference in the formula, and the column references will change relatively in each cell across the page - even though you won't see this happening)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,569
Messages
5,596,913
Members
414,110
Latest member
docops

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
Top