Finding the name of shape in a macro?

  • Thread starter Thread starter Don Wiss
  • Start date Start date
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>.
 
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>.
 
Back
Top