When I first started to answer this I thought it was possible, but was going to be very hard to do. I thought you'd have to go through the formula character by character, but as I researched it a little I found that it is very easy to do.
There are two properties of the Range Object that help you out on this: the HasFormula property and the Precedents property or DirectPrecedents property.
The HasFormula property basically is easy enough to figure out. It tells you if the cell has a formula in it or not. The Precedents property tells you the cells that cell references directly or indirectly. The DirectPrecedents property tells you what cells that cell directly references.
So basically we create a little loop like this:
Dim MyRange As Range
Dim x As Range
Set MyRange = Range("G1:G10")
For Each x In MyRange
If x.HasFormula = True Then
x.Interior.ColorIndex = 3
x.DirectPrecedents.Interior.ColorIndex = 4
End If
Next x
The macro above basically searches through cells G1:G10 and every cell that has a formula it colors red. Every cell that is a direct precedent of that cell with a formula gets colored green. Although you may want to add only little tidbit more to it:
Dim MyRange As Range
Dim x As Range
Dim y As Range
Set MyRange = Range("G1:G10")
For Each x In MyRange
If x.HasFormula = True Then
x.Interior.ColorIndex = 3
For Each y In x.DirectPrecedents
If y.HasFormula = True Then
y.Interior.ColorIndex = 3
Else
y.Interior.ColorIndex = 4
End If
Next y
End If
Next x
This extra check makes sure that if the direct precedents have a formula that they are colored red, so that all of the cells with formulas are colored red. Or you might want to change the 3 on:
y.Interior.ColorIndex = 3
To
y.Interior.ColorIndex = 6
So that direct precedents with formulas are colored yellow.
I tried the code out and it worked. I tend to learn when I answer Excel macro questions on here, so I try to answer some on here every so often. Your problem was easier to address than I thought.
You can also use the Dependents property or DirectDependents property to find out if that cell affects other cells.