Hi all,
I am rewriting VBA in an excel macro workbook that was originally created with the VBA Recorder. I tried to clean it up, but was unsure if I could get rid of every reference to the "Selection" of a range of values.
Is my syntax OK? Do I need to change parts of it? What can I do to get this to work?
FYI - mainSh12 is a reference to a Worksheet Object.
I am rewriting VBA in an excel macro workbook that was originally created with the VBA Recorder. I tried to clean it up, but was unsure if I could get rid of every reference to the "Selection" of a range of values.
Is my syntax OK? Do I need to change parts of it? What can I do to get this to work?
FYI - mainSh12 is a reference to a Worksheet Object.
Code:
Set Rng24 = mainSh12.Range("P2:P" & lastrowSEres)
With Rng24
.Select
.FormatConditions.Delete 'Either this line, or the 4th is Unnecc.
.FormatConditions.Add Type:=xlExpression, Formula1:="=P2=""Research"""
.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
.FormatConditions(1).Interior.Color = 65535
.FormatConditions(1).StopIfTrue = False
End With