View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Finding the name of an object using VB

Another way -

MsgBox ActiveSheet.Ovals(ActiveSheet.Ovals.Count).Name

Both Harold's & my examples assume the ZOrder has not been changed since the
last was added, eg send-to-back the last added or bring-to-front some other.

or, as you say you are adding an oval with code

Dim shp as Shape
Set shp = ActiveSheet.Shapes.AddShape(msoShapeOval, 50, 50, 100, 100)
MsgBox shp.Name

Regards,
Peter T

"Ken" wrote in message
...
Say I have just added an object (Oval) into the worksheet. How do I find

it's
name that Excel assigned it via VB code?
--
Ken