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
|