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.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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?
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,507
Messages
6,114,029
Members
448,543
Latest member
MartinLarkin

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