PDA

View Full Version : VBA targeting #Ref!


Capuchin
Mar 30, 2007, 05:35 AM
I want to determine if a cell has returned the #REF! Error using an if statement, I have no idea how to address this.

I've tried:

If [Cell] = "#REF!" Then....
To no avail, returns a type mismatch, any other ideas? :)

ScottGem
Mar 30, 2007, 06:45 AM
Try this:

If Evaluate("=ERROR.TYPE(" & Address & ")") = 4 Then
action code
End If

Capuchin
Mar 30, 2007, 07:28 AM
Same problem, type mismatch :/