S
Shawn
I recorded this code but I need it to do more and work a little differently.
I need it to first remove any existing "Conditional" formatting. Not all
formatting, just remove the existing conditional formatting. I then need to
add the conditional formatting as detailed below.
Also, my intent was to copy the formatting from the first cell into others.
I need it to do all this with out selecting (.Select). Please help.
Sheets("Travel").Range("R7:R8").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=(IF(R9>0,0,IF(SUM(T9)>0,1,0)))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.Copy
Range("R9:R10,R12:R13,R15:R16").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
I need it to first remove any existing "Conditional" formatting. Not all
formatting, just remove the existing conditional formatting. I then need to
add the conditional formatting as detailed below.
Also, my intent was to copy the formatting from the first cell into others.
I need it to do all this with out selecting (.Select). Please help.
Sheets("Travel").Range("R7:R8").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=(IF(R9>0,0,IF(SUM(T9)>0,1,0)))>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.Copy
Range("R9:R10,R12:R13,R15:R16").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False