Change cell color not using conditional formatting

datamster

Board Regular
Joined
Jan 25, 2016
Messages
58
Hi all,

Is it possible to use a function (if statement or an array?) to change the color of a cell without using conditional formatting. I don't want to use conditional formatting because the workbook is already full of formulas and takes a fair amount of time to update. Thank you.
 

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
The only formula way is with conditional formatting.

You could use some VBA macro code to do it.
Can you get more specific about which cells need to change to which colors based on what criteria?
 

datamster

Board Regular
Joined
Jan 25, 2016
Messages
58
More specifically I have a list of names and a color assigned to each name, then have rows of data that correlates to a name. The data is pulled from a database and has a macro to auto-run. I don't have confidence in conditional formatting to do this unmonitored.
 

datamster

Board Regular
Joined
Jan 25, 2016
Messages
58
Here is a simple formula of where I'm going with this. =IF(Z12="American Airlines","[Green]",""). Obviously this just shows the word green. In format cells [] are used to turn negative numbers red. What is the syntax to turn the cell green from within the IF formula, or is there a better formula to use. Thank you for any help on this.
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Other than that little trick turning negative numbers green with custom formatting
Conditional formatting is the only way to apply formats to cells based on a formula result.


You'd have to use VBA
Code:
Sub Test
If Range("Z12").Value = "American Airlines" Then
    Range("Z12").Interior.Color = vbgreen
End If
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,123,321
Messages
5,600,950
Members
414,417
Latest member
Nobu

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