Hi!
This is my first time posting. I am a beginner with Macros. I was able to get most of what I wanted to do by searching through numerous message boards online but I'm stuck in one section. The code below applies a conditional format (orange highlight) to 6 specific columns based on whether those columns contain a specific text. I would like to add another step after this coding where the cells of another column (column B) are highlighted in a different color (yellow) if ANY of the 6 columns contain the orange highlighted conditional formatting.
So for example - In Row 2, if any of the 6 columns contain the conditional formatting of an orange highlight, then B2 will be highlighted in yellow.
Can anyone please help? I've look into examples with If and then statements but most of the examples online only deal with one column whereas in my example, the coding would have to check all 6 columns. I've been driving myself crazy trying to figure this out. Any help would be greatly appreciated!
Thanks
Sub SearchText()
Range("X:X,Z:Z,AE:AE,AJ:AJ,AO:AO,AT:AT").Select
Range("AT5").Activate
Selection.FormatConditions.Add Type:=xlTextString, String:="concrete", _
TextOperator:=xlContains
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
This is my first time posting. I am a beginner with Macros. I was able to get most of what I wanted to do by searching through numerous message boards online but I'm stuck in one section. The code below applies a conditional format (orange highlight) to 6 specific columns based on whether those columns contain a specific text. I would like to add another step after this coding where the cells of another column (column B) are highlighted in a different color (yellow) if ANY of the 6 columns contain the orange highlighted conditional formatting.
So for example - In Row 2, if any of the 6 columns contain the conditional formatting of an orange highlight, then B2 will be highlighted in yellow.
Can anyone please help? I've look into examples with If and then statements but most of the examples online only deal with one column whereas in my example, the coding would have to check all 6 columns. I've been driving myself crazy trying to figure this out. Any help would be greatly appreciated!
Thanks
Sub SearchText()
Range("X:X,Z:Z,AE:AE,AJ:AJ,AO:AO,AT:AT").Select
Range("AT5").Activate
Selection.FormatConditions.Add Type:=xlTextString, String:="concrete", _
TextOperator:=xlContains
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub