A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Easy to rearrange the code to check for the link first:
Sub TestMacro2()
Dim rngC As Range
Dim rngA As Range
Dim strA As String
Set rngA = ActiveSheet.UsedRange
rngA.SpecialCells(xlCellTypeConstants).Font.Color = vbBlue
For Each rngC In rngA.SpecialCells(xlCellTypeFormulas)
If InStr(1, rngC.Formula, "!") > 0 Then
rngC.Font.Color = vbGreen
Else
On Error GoTo NextCheck
strA = rngC.Precedents.Address
rngC.Font.Color = vbBlack
GoTo SheetRefsOnly
NextCheck:
Resume CheckLinks
CheckLinks:
rngC.Font.Color = vbBlue
End If
SheetRefsOnly:
Next rngC
End Sub