No, not necessary. What you do is put
On Error Resume Next
immediately before the statement in question and then
On Error GoTo 0
immediately after it.
From my example:
> XX = "No"
> On Error Resume Next
> XX = Target.Name.Name
> On Error GoTo 0
Better, though, is to encapsulate the bit of code involved into a
function (or subroutine). This is a little function from my common
functions that returns the name of a range if it has one.
Public Function CellRangeName(ByVal TheCell As Range) As String
CellRangeName = ""
On Error Resume Next
CellRangeName = TheCell.Name.Name
End Function
In this case, the On Error will be cancelled when the function finishes.
I agree with the awkward look of the double negative, but there is no "is
something" unfortunately.
I also like Tou's comparison of addresses. It certainly has a "clean" feel
to it.