JenniferNash
New Member
- Joined
- Oct 4, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Help! I have spent DAYS trying to figure this out. Disclaimer - I don't know VBA and have been trying to figure this out.
This part is working perfectly:
Sub ZScoreCF1()
Range("AD10:AD154").Select
Application.CutCopyMode = False
Selection.FormatConditions.AddColorScale ColorScaleType:=3
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).ColorScaleCriteria(1).Type = _
xlConditionValueNumber
Selection.FormatConditions(1).ColorScaleCriteria(1).Value = -1.282
With Selection.FormatConditions(1).ColorScaleCriteria(1).FormatColor
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0
End With
Selection.FormatConditions(1).ColorScaleCriteria(2).Type = _
xlConditionValueNumber
Selection.FormatConditions(1).ColorScaleCriteria(2).Value = 0
With Selection.FormatConditions(1).ColorScaleCriteria(2).FormatColor
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
Selection.FormatConditions(1).ColorScaleCriteria(3).Type = _
xlConditionValueNumber
Selection.FormatConditions(1).ColorScaleCriteria(3).Value = 1.282
With Selection.FormatConditions(1).ColorScaleCriteria(3).FormatColor
.ThemeColor = xlThemeColorDark2
.TintAndShade = 0
End With
End Sub
I want to be able to do this same thing for Column AD with the addition of another variable in Column L.
Column L has categories (ex: Equity or Patient Centeredness). If Column L has Patient Centeredness, then and only then do I want the above to be applied.
Thank you so much for your expertise!
Jennifer
This part is working perfectly:
Sub ZScoreCF1()
Range("AD10:AD154").Select
Application.CutCopyMode = False
Selection.FormatConditions.AddColorScale ColorScaleType:=3
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).ColorScaleCriteria(1).Type = _
xlConditionValueNumber
Selection.FormatConditions(1).ColorScaleCriteria(1).Value = -1.282
With Selection.FormatConditions(1).ColorScaleCriteria(1).FormatColor
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0
End With
Selection.FormatConditions(1).ColorScaleCriteria(2).Type = _
xlConditionValueNumber
Selection.FormatConditions(1).ColorScaleCriteria(2).Value = 0
With Selection.FormatConditions(1).ColorScaleCriteria(2).FormatColor
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
Selection.FormatConditions(1).ColorScaleCriteria(3).Type = _
xlConditionValueNumber
Selection.FormatConditions(1).ColorScaleCriteria(3).Value = 1.282
With Selection.FormatConditions(1).ColorScaleCriteria(3).FormatColor
.ThemeColor = xlThemeColorDark2
.TintAndShade = 0
End With
End Sub
I want to be able to do this same thing for Column AD with the addition of another variable in Column L.
Column L has categories (ex: Equity or Patient Centeredness). If Column L has Patient Centeredness, then and only then do I want the above to be applied.
Thank you so much for your expertise!
Jennifer