Display ALL Names of Drawing Objects

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?
 
N

NickHK

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
 
T

Tom Ogilvy

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
 

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