On 2002-10-15 09:54, Panikos wrote:
I would like to write an "IF" function where when the answer is right then the result will come up in a colour(e.g.blue) and if it it is wrong it would come up in a different colour(e.g.red).
This can also be accomplished (to a limited extent) using custom number formatting. For discussion purposes suppose a "right" result if >= 0 and a "wrong" one is negative. The following number format would accomplish your objective...
For more on custom number formatting see the Excel Help topics for "Create a custom number format" and "About number format codes for decimal places, spaces, colors, and conditions".
Hi Try this add to the sheet module as is and test
Edit is easy need to keep array the same add words to same number of colour choices, play arroud good fun
Option Base 1
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
' Dedicated to all the guys who help +
' support Jack on this board thanks so much
Dim Names As Variant
Dim Colours As Variant
Dim x As Integer
Dim y As Integer
Names = Array("Jack", "UK")
'Above are object to the text in these cells
' these wil also colour that word to @cool eh!@
Colours = Array(6,
' 6 - Yellow
' 8 - Blue
For x = 1 To UBound(Names)
y = InStr(1, Target.Value, Names(x))
If y > 0 Then
With Target.Characters _
.ColorIndex = Colours(x)
.FontStyle = "Bold"