Conditional Formatting (Macro)

Magy_22

New Member
Joined
Mar 29, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello Excel Experts!!
I am new in the VBA world, and I have an issue I hope you can help me solve.
When I have a set of data, and I set a conditional format to all this data, but there is one item that doesn’t apply, we must make it the opposite ). Can I have code do it? For a particular item every time?

Example:
Revenues:
if the number > 0 make the font color green and if the number <0 make it red

Expenses:
if the number > 0 make the font color red and if the number <0 make it green

GOP:
if the number > 0 make the font color green and if the number <0 make it red


I really appreciate any help you can provide.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
why do you want to do it in VBA.
That can be done with the normal formulas, isn't it ?
 
Upvote 0

Forum statistics

Threads
1,215,222
Messages
6,123,716
Members
449,116
Latest member
Aaagu

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