I need to specify different text colours for certain conditions. This I can do with the conditional formatting but only for three conditions, I have tried to write some VBA code to allow me to call two or more routines to get more conditions The code only partially works, can anyone tell me where i am going wong, I am sure that this can be done. Code below. Thanks Badger163.
Sub Audit1()
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""no"""
Selection.FormatConditions(1).Interior.ColorIndex = 3
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""?"""
Selection.FormatConditions(2).Interior.ColorIndex = 3
Audit 2
End Sub
Sub Audit2()
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""/"""
Selection.FormatConditions(1).Interior.ColorIndex = 8
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""yes"""
Selection.FormatConditions(2).Interior.ColorIndex = 8
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""n/a"""
Selection.FormatConditions(3).Interior.ColorIndex = 8
End Sub
,
Configuration: Windows XP Internet Explorer 6.0