I have two ranges, one call PNames and the other is Sch_Date.
PNames goes from A2:A10.
Sch_Data goes from D2:J10.
I'm trying to code a line in VBA that will look at the value in A2 (to see if it has the word Total in it) and if so will then conditionally format the cells in Sch_Data that are also in row A based on whether the value in Sch_Data = 100.
Here' the code that doesn't work:
Range("Sch_Data").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=AND(RIGHT(Name,5)=""Total"", Sch_Data <>100)"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 3
End With
Can someone tell me what I'm doing wrong?
Thanks
PNames goes from A2:A10.
Sch_Data goes from D2:J10.
I'm trying to code a line in VBA that will look at the value in A2 (to see if it has the word Total in it) and if so will then conditionally format the cells in Sch_Data that are also in row A based on whether the value in Sch_Data = 100.
Here' the code that doesn't work:
Range("Sch_Data").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=AND(RIGHT(Name,5)=""Total"", Sch_Data <>100)"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 3
End With
Can someone tell me what I'm doing wrong?
Thanks