I created a VBA Script to run a conditional formatting on a sheet to highlight name matches.
Each time the script is ran the one part of the formula gets changed, coincidentally and maybe related, the number it changes to is one more than the color code.
Here is part of my script and the formula.
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($J$1:$J$108,$A1)>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
The formulac keeps changing to
"=COUNTIF($J$1:$J$108,$A65536)>0"
and highlighting the cell below the one it should be.
Any help or guidance would be greatly appreciated.
Bookmarks