This answer relies on the FORMULATEXT function which is not available prior to Excel 2013. Also I'm going to crib some code from this useful post which shows a reasonably simple way of adding multiple conditions to cells.
So for your 4 criteria we can use FORMULATEXT for each:
- Hardcoded cells:
=AND(ISNA(FORMULATEXT(A2)),NOT(ISBLANK(A2)))
- Cells with formula:
=NOT(ISNA(FORMULATEXT(A2)))
- Cells with links to other sheets:
=NOT(ISERROR(SEARCH(""*!*"",FORMULATEXT(A2),1)))
- Cells with external links:
=NOT(ISERROR(SEARCH(""*.xls*]*!*"",FORMULATEXT(A2),1)))
Noting:
Formula 1 has the distinction that the logic says any value that is not a formula which most of the time will mean a hard-coded value.
Formula 2 is the inverse of Formula 1 in that any non-error with FORMULATEXT means it's a formula
Formulas 3 and 4 are per your wildcard logic except I only implemented the Like "*!*" bit and not the other clauses - you can extend the formula for this although it might end up on the complex side.
The order within the conditional format matters. In the code below, the order is actually 1, 4, 3, 2 because 4 is a special case of 3 (i.e. contains a !) and 4 and 3 are special cases of 2 (i.e. all 3 are formulas).
So the code I used is:
Option Explicit
Sub CellShader()
Dim rng As Range
Set rng = Sheet1.Range("A2:A6")
' delete existing conditional formatting
rng.FormatConditions.Delete
' add your 4 rules in order 1, 4, 3, 2
AddRule rng, "=AND(ISNA(FORMULATEXT(A2)),NOT(ISBLANK(A2)))", vbCyan
AddRule rng, "=NOT(ISERROR(SEARCH(""*.xls*]*!*"",FORMULATEXT(A2),1)))", vbMagenta
AddRule rng, "=NOT(ISERROR(SEARCH(""*!*"",FORMULATEXT(A2),1)))", vbRed
AddRule rng, "=NOT(ISNA(FORMULATEXT(A2)))", vbGreen
End Sub
' https://stackoverflow.com/questions/40209398/conditional-formatting-vba-multiple-conditions
Sub AddRule(rng As Range, strFormula As String, lngColor As Long)
With rng.FormatConditions
With .Add(Type:=xlExpression, Formula1:=strFormula)
.Interior.Color = lngColor
.StopIfTrue = True
End With
End With
End Sub
Used on these test cases it produces the correct result:

You can see A2 is blank and is not being formatted as it is a not-a-formula, but does not contain any value (hard-coded or otherwise).
HTH