Selecing a picture in VBA

P

PaulS

Hi,

Does anyone know any way to select a shape/picture or
reference a shape/picture to delete it if you don't know
either the name of the picture or its reference (shapes)
number? Is there anyway to select a shape/picture based
on its position on a sheet?

Thanks

Paul
 
J

Jake Marx

Hi Paul,

You could loop through the sheet's Shapes collection and find the top-left
cell of each Shape:

Sub WhereAreMyShapes()
Dim shp As Shape

For Each shp In Sheet1.Shapes
MsgBox shp.Name & ": " & _
shp.TopLeftCell.Address
Next shp
End Sub
 
P

PaulS

Thanks Jake, that would probably work fine - pitty I
didn't get it earlier as I changed my code to use the
Zorder of a shape instead of copying and pasting it to
display it.

Thanks anyway.

Paul
 

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