I'm trying to make a find and replace macro where the text remains the same but only the format changes. I have a large list of products for example labeled 1-10,000 and I only need to highlight certain numbers within the list. I tried to make a macro for one single instance, then expand it into a range, but keep getting an error. Can anyone help? Thank you.
Dim arrayID() As Variant
'
With Application.ReplaceFormat.Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Replace What:=arrayID(E95:E15531), Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=True, FormulaVersion:=xlReplaceFormula2
Dim arrayID() As Variant
'
With Application.ReplaceFormat.Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Replace What:=arrayID(E95:E15531), Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=True, FormulaVersion:=xlReplaceFormula2