Display ALL Names of Drawing Objects

  • Thread starter Thread starter Corey
  • Start date Start date
C

Corey

Is there a short code that would display ALL the names given by code to
drawing objects with in a worksheet.

I have placed approximately 800 different objects on a worksheet, they will
eventualy used in a code to display Not Display.
But firstly i had to NAME them individually to allow for the code.
Being 800 odd i want to make sure i have not missed any, so hence the reason
for the displaying of the objects names needed.

I would like them possibly to be displayed in a new worksheet so i can view
them.

Can anyone assist me?
 
Corey,
There's the DrawingObjects collection you can loop through, printing .Name
in a suitable location.

Whilst obviously possible, do you really need 800/sheet ?
Can you not move or show/hide a few when/if needed ?

NickHK
 
Sub ListDrawingObjects()
Dim sh As Worksheet
Dim sh1 As Worksheet
Dim drwng As Object
Set sh = Worksheets("Sheet1")
Worksheets.Add after:=Worksheets(Worksheets.Count)
Set sh1 = ActiveSheet
i = 0
For Each drwng In sh.DrawingObjects
i = i + 1
sh1.Cells(i, 1) = drwng.Name
sh1.Cells(i, 2) = drwng.TopLeftCell.Address(0, 0)
Next
End Sub
 
Back
Top