Cell Names

B

Bob

Hi all:

In excel 2003 VBA, is there a way of knowing if a cell (or groups of cells)
have a name, and if so, what is that name? I know how to get all the
defined names, but not for a particular cell.

Thanks;

Bob
 
D

Dave Peterson

Dim myRng as range
dim myName as string
set myrng = worksheets("Sheet99").range("a1")

myname = ""
on error resume next
myname = myrng.name.name
on error goto 0

if myname = "" then
msgbox "no name"
else
msgbox myName
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top