Can anyone assist me . I am trying to add conditional formatting into a spreadsheet from progress.
I have recorded the macro in excel to see if I can work out the progress lines.
I need to change the background colour depending on 2 formula.
So to set cell B3 to colour 34 if ah3 > 0 or to colour 39 if d3 > e3.
Range("B3").Select -
Color numbers are not the ones I want but do for a sample.
Cells.FormatConditions.Delete
Range("B3").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=""ah3 > 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
Range("B3").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=""d3 > e3"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.399945066682943
End With
Selection.FormatConditions(1).StopIfTrue = False
I have got the code to :-
chworksheet:range("A" + STRING(lxx) + ":B" + STRING(lxx)):formatconditions:ADDTYPE:xlexpression:formula1="=D" + STRING(lxx) + "> E" + STRING(lxx).
chworksheet:range("A" + STRING(lxx) + ":B" + STRING(lxx)):formatconditions:Interior:colorindex = 39.
chworksheet:range("A" + STRING(lxx) + ":B" + STRING(lxx)):formatconditions:ADDTYPE:xlexpression:formula1="AH" + STRING(lxx) + "> 0" .
chworksheet:range("A" + STRING(lxx) + ":B" + STRING(lxx)):formatconditions:Interior:colorindex = 34.
I know I am completely wrong on this . Any help would be appreciated.
I have recorded the macro in excel to see if I can work out the progress lines.
I need to change the background colour depending on 2 formula.
So to set cell B3 to colour 34 if ah3 > 0 or to colour 39 if d3 > e3.
Range("B3").Select -
Color numbers are not the ones I want but do for a sample.
Cells.FormatConditions.Delete
Range("B3").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=""ah3 > 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
Range("B3").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=""d3 > e3"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.399945066682943
End With
Selection.FormatConditions(1).StopIfTrue = False
I have got the code to :-
chworksheet:range("A" + STRING(lxx) + ":B" + STRING(lxx)):formatconditions:ADDTYPE:xlexpression:formula1="=D" + STRING(lxx) + "> E" + STRING(lxx).
chworksheet:range("A" + STRING(lxx) + ":B" + STRING(lxx)):formatconditions:Interior:colorindex = 39.
chworksheet:range("A" + STRING(lxx) + ":B" + STRING(lxx)):formatconditions:ADDTYPE:xlexpression:formula1="AH" + STRING(lxx) + "> 0" .
chworksheet:range("A" + STRING(lxx) + ":B" + STRING(lxx)):formatconditions:Interior:colorindex = 34.
I know I am completely wrong on this . Any help would be appreciated.