If you want to determine whether a specific cell has a formula or a value then you need to check a range property called “HasFormula”. Here is an example where the border color of a cell is changed to red if it has a formula, otherwise it is set to black.
Dim myRange As String
myRange = “B5″
If ActiveSheet.Range(myRange).HasFormula Then
ActiveSheet.Range(myRange).Borders.Color = RGB(255, 0, 0)
Else
ActiveSheet.Range(myRange).Borders.Color = 0
End If
Suggested Post:
How to write a VBA macro

