First I'd like to say how much I appreciate this resource & all the help that has been provided.
I'm new to this, but have been experimenting with creating macro's & vba.
My problem is with conditional formatting more than 3 colors based on different cell values & text (doesn't always fill all the cells even when I adjust priority). I'd also like to do a couple text/date auto-fill functions based on the same info.
Here's what I got:
S3:U82 contain the conent that will determine fill
S3:U82, G3:K82 all get color filled based on the content (same row)
1) - =OR($S3<>0,$K3<>0,$L3<>0) (anything not equal to 0) fills same row with Yellow RGB (255, 255, 0)
2) - S3:U82 ="" (blanks in any cell) fills same row with Orange RGB (247,150,70)
3) - =SEARCH("Linear", $J3)>0 (Searches J3:J82 & fill over rides #2 Yellow) fills with Red RGB (255, 0, 0)
5) - =SEARCH("LSA", $J3)>0 (Searches J3:J82 & fill over rides #2 Yellow) fills with Grey RGB (191,191,191)
4) - =AND($S3=0,T3=0,U3=0) (all 3 rows in S3:U82 must each =0) fills with Green RGB (146, 208, 80)
4a) - Stamps the day it was turned green in column J same row. (This will erase "Linear" & should turn row geen). Unsure how to do this. Today() always keeps current day, but I want the day it was turned green (or all 3 "0" that caused it to turned green).
4b) - Places "Text" in column K same row. (Text will always be the same for any row)
.Here's what the macro recorder gives for each, but I'm unsure how to incorporate all 5 together & to do the couple other functions I'm looking for. The conditional format just seems flaky & doesn't always take affect).
Thanks to anyone that might be of help.
Sub Format1()
Range("G3:K82,S3:U82").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=OR($S3<>0,$K3<>0,$L3<>0)"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
Sub Format2()
Range("G3:K82,S3:U82").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$S3="""""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
Sub Format3()
Range("G3:K82,S3:U82").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=SEARCH(""Lin"", $J3)>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
Sub Format4()
Range("G3:K82,S3:U82").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=SEARCH(""LSA"", $J3)>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249946592608417
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
Sub Format5()
Range("G3:K82,S3:U82").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=AND($S3=0,$T3=0,$U3=0)"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
ActiveWorkbook.Save
End Sub
Bookmarks