Error if 'name' already exists
Dim nm as Name
On Error Resume Next
set nm = thisworkbooks.names(target.value)
On Error goto 0
if not nm is nothing then
msgbox "Name " & target.Value & " already exists"
exit sub
end if
--
Regards,
Tom Ogilvy
"Kevin O'Neill" wrote in message
ups.com...
What i have are cells, that when you type say "AAA" into the cell, it
will do a worksheet change event, and add "AAA" as a name to my
worksheet.
What I'd like to do is, if the user types in a name into one of these
cells, and the 'name' already exists as a name, it will return a pop up
box error telling them to choose a different name and 'End' my name
naming 'Sub'
Cheers.
Kevin.
|