Is it possible to search specific text in a formula using vba? For example: I have a bunch of index(array match(array,"criteria"0),0) and other sum formulas. I want to search formulas with "index" and change cells color.
Thus far I have written the following code:
For Each cell In ActiveSheet.UsedRange 'color cells having formulas
If cell.HasFormula Then
Find = "*index*"
cell.Font.Color = indexcolor
End if
Next cell
c.Interior.Color = vbRedto highlight the cells. The above link even includes the VBA code you need (pre-written by Microsoft for you). - Ralph