Finding the name of shape in a macro?

D

Don Wiss

If the user's focus is in a Rectangle or Text Box, and they press a button
that calls a macro, how can the macro determine the name of that shape? (So
it can select it and do a CheckSpelling.)

Don <donwiss at panix.com>.
 
W

William

Hi Don

To return the type of object selected, try
MsgBox "The object selected is a " & TypeName(Selection)

To return the name of the object selected, try
MsgBox "The name of the object selected is " & Selection.Name

--
XL2002
Regards

William

(e-mail address removed)

| If the user's focus is in a Rectangle or Text Box, and they press a button
| that calls a macro, how can the macro determine the name of that shape?
(So
| it can select it and do a CheckSpelling.)
|
| Don <donwiss at panix.com>.
 

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