Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formula to manipulate cell font
I realize that in some cases you can use conditional formatting to
change the color of the cell contents according to cell value, but I need to change the color of one cell's contents according to the value of a different cell. For instance....if B1 = x, then C1 is red but if B1 = y, then C1 is blue..........any suggestions. Clay |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formula to manipulate cell font
You can do that with conditional formatting as well. You can change Cell
Value is to formula is and put in a formulat that refers to the other cell. -- Regards, Tom Ogilvy "crs" wrote: I realize that in some cases you can use conditional formatting to change the color of the cell contents according to cell value, but I need to change the color of one cell's contents according to the value of a different cell. For instance....if B1 = x, then C1 is red but if B1 = y, then C1 is blue..........any suggestions. Clay |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formula to manipulate cell font
You can still use conditional formatting. Change Cell Value is to Formula is.
The formula you want is =B1=x for one condition and for the second condition =B1=y. set your font colors on each and you are good to go... -- HTH... Jim Thomlinson "crs" wrote: I realize that in some cases you can use conditional formatting to change the color of the cell contents according to cell value, but I need to change the color of one cell's contents according to the value of a different cell. For instance....if B1 = x, then C1 is red but if B1 = y, then C1 is blue..........any suggestions. Clay |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formula to manipulate cell font
Clay, Try this. However, coding this depends on how many formatting
choices you want. Sub TestFormat() Dim MyCell As Range For Each MyCell In Selection If MyCell.Value = "x" Then With MyCell.Offset(0, 1).Font .Bold = True .ColorIndex = 3 End With Else With MyCell.Offset(0, 1).Font .Bold = True .ColorIndex = 5 End With End If Next MyCell End Sub crs wrote: I realize that in some cases you can use conditional formatting to change the color of the cell contents according to cell value, but I need to change the color of one cell's contents according to the value of a different cell. For instance....if B1 = x, then C1 is red but if B1 = y, then C1 is blue..........any suggestions. Clay |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formula to manipulate cell font
Thanks so much for the quick response. The idea didn't even cross my
mind. Clay Tom Ogilvy wrote: You can do that with conditional formatting as well. You can change Cell Value is to formula is and put in a formulat that refers to the other cell. -- Regards, Tom Ogilvy "crs" wrote: I realize that in some cases you can use conditional formatting to change the color of the cell contents according to cell value, but I need to change the color of one cell's contents according to the value of a different cell. For instance....if B1 = x, then C1 is red but if B1 = y, then C1 is blue..........any suggestions. Clay |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formula to manipulate cell font
Thanks to everyone for the help -
Asking is one of the best ways to learn! wrote: Clay, Try this. However, coding this depends on how many formatting choices you want. Sub TestFormat() Dim MyCell As Range For Each MyCell In Selection If MyCell.Value = "x" Then With MyCell.Offset(0, 1).Font .Bold = True .ColorIndex = 3 End With Else With MyCell.Offset(0, 1).Font .Bold = True .ColorIndex = 5 End With End If Next MyCell End Sub crs wrote: I realize that in some cases you can use conditional formatting to change the color of the cell contents according to cell value, but I need to change the color of one cell's contents according to the value of a different cell. For instance....if B1 = x, then C1 is red but if B1 = y, then C1 is blue..........any suggestions. Clay |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
formula to change font or cell colour | Excel Worksheet Functions | |||
Excel: How to insert carriage returns in a formula to manipulate t | Excel Worksheet Functions | |||
How to Manipulate formula for Binomial Distribution | Excel Worksheet Functions | |||
Change font/cell color by Formula | Excel Worksheet Functions | |||
different font format in the same cell but using a formula | Excel Programming |