ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   conditional for fill color? (https://www.excelbanter.com/excel-programming/385592-conditional-fill-color.html)

[email protected]

conditional for fill color?
 
Is there a formula I can use to change the fill color of a cell?
like: IF A53 , color = 5


Ed

conditional for fill color?
 
On Mar 19, 9:29 am, wrote:
Is there a formula I can use to change the fill color of a cell?
like: IF A53 , color = 5


Check out Conditional Formatting under the Format menu.
Ed


Jay

conditional for fill color?
 
Hi jdifrancesco1 -

Here are two methods:

Method 1 (The User Interface)
a. Select Cell A5 and choose |Format|Conditional Formatting...
b. Change Condition1 from "Cell Value Is" to "Formula Is"
c. In the reference box to the right of Condition1, enter the formula
"=A53" (without quotes).
d. Finally, press the [Format...] button and choose your fill color from the
pallete on the 'Patterns' tab.

Method 2 (VBA)
Place the following code in the module of the worksheet of interest:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A8") 3 Then Range("A8").Interior.ColorIndex = 5
End Sub

To find out which colors are available in the pallette, copy the following
utililty to a standard VB module and run it from a blank worksheet. The row
number of each color is its colorindex (to use in the procedure above):

Sub jdi_Pallette()
For i = 1 To 56
Cells(i, 1).Interior.ColorIndex = i
Next i
End Sub
--
Jay


" wrote:

Is there a formula I can use to change the fill color of a cell?
like: IF A53 , color = 5




All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com