View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
macropod
 
Posts: n/a
Default Changing text color usinf a formula (NOT Conditional Formatting)

Hi Peo,

The OP wants a solution that doesn't entail conditional formatting.

Perhaps an event-driven macro, such as the following, which could be put in
the Workbook module (if that doesn't count as conditional formatting)?

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Dim i As Integer
Dim j As Integer
With ThisWorkbook.Sheets("Sheet1")
If .Range("B9") = "" Or .Range("N9") = "" Or .Range("Z9") = "" _
Or .Range("AL9") = "" Then
.Range("G4").Font.ColorIndex = 3
Else
.Range("G4").Font.ColorIndex = 1
End If
End With
End Sub

Cheers

--
macropod
[MVP - Microsoft Word]


"Peo Sjoblom" wrote in message
...
look in help for conditional formatting
in the formula is box put

=COUNTA(B9,N9,Z9,AL9)=4

click the format button and select font colour and click OK twice

the above means that all 4 cells need to have data for this to happen

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey


"John Elliott" <John wrote in message
...
Is it possible to change the color of text using a formula, such as an

IF
statement? What I have in mind is something like this (stated simply):

If
cells B9 or N9 or Z9 or AL9 are blank, do nothing, else color text in

cell
S4
red.