tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,210
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi everyone,
I get this a lot and cant work out,
I have some conditional foramting coodes and when run on there own work great but when run one after the other I get conditions not set for the last ones?
how can I stop this?
my codes are
I get this a lot and cant work out,
I have some conditional foramting coodes and when run on there own work great but when run one after the other I get conditions not set for the last ones?
how can I stop this?
my codes are
VBA Code:
Sub cond2()
Dim MyRange As Range
Set MyRange = Range("C:C")
MyRange.FormatConditions.Add Type:=xlExpression, Formula1:="=IF($C1=""No Description!"",TRUE)"
MyRange.FormatConditions(1).Font.Color = RGB(192, 0, 0) 'red
MyRange.FormatConditions(1).Interior.Color = RGB(255, 255, 0) 'yellow
MyRange.FormatConditions(1).Borders.Color = RGB(192, 0, 0)
MyRange.FormatConditions(1).StopIfTrue = False
MyRange.FormatConditions.Add Type:=xlExpression, Formula1:="=IF($BH1="""",FALSE,IF($BH1=FALSE,TRUE))"
MyRange.FormatConditions(2).Font.Color = RGB(192, 0, 0) 'red
MyRange.FormatConditions(2).Interior.Color = RGB(250, 230, 215) 'light red
MyRange.FormatConditions(2).Borders.Color = RGB(192, 0, 0)
MyRange.FormatConditions(2).StopIfTrue = False
End Sub
Sub cond5()
Dim MyRange As Range
Set MyRange = Range("A:A")
MyRange.FormatConditions.Add Type:=xlExpression, Formula1:="=IF($BF1="""",FALSE,IF($BF1=FALSE,TRUE))"
MyRange.FormatConditions(1).Font.Color = RGB(192, 0, 0) 'red
MyRange.FormatConditions(1).Interior.Color = RGB(250, 230, 215) 'light red
MyRange.FormatConditions(1).Borders.Color = RGB(192, 0, 0)
MyRange.FormatConditions(1).StopIfTrue = False
End Sub
Sub cond10()
Dim MyRange As Range
Set MyRange = Range("A11:G500")
MyRange.FormatConditions.Add Type:=xlExpression, Formula1:="=ISEVEN($AZ11)"
MyRange.FormatConditions(1).Interior.Color = RGB(240, 240, 240) 'light grey
MyRange.FormatConditions(1).Borders(xlTop).Color = RGB(220, 220, 220)
MyRange.FormatConditions(1).StopIfTrue = False
MyRange.FormatConditions.Add Type:=xlExpression, Formula1:="=ISODD($AZ11)"
MyRange.FormatConditions(2).Interior.Color = RGB(230, 230, 230) 'light grey
MyRange.FormatConditions(2).Borders(xlTop).Color = RGB(220, 220, 220)
MyRange.FormatConditions(2).StopIfTrue = False
End Sub