vba conditional formatting
I am working on a spreadsheet that requires 480 cells with conditional formatting that is all the same conditions. I've written a macro to insert eh conditions in each cell, but the cell reference gets entered as "Q31" instead of Q31.
Can someone help me get rid of the quotes?
Here is the code
Dim rCell As Range
Dim sCell As String
Set rCell = ActiveCell.Offset(-1, 0)
sCell = rCell.Address(False, False)
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:=sCell
Selection.FormatConditions(Selection.FormatConditi ons.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Thanks!
|