Selecing a picture in VBA

  • Thread starter Thread starter PaulS
  • Start date Start date
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
 
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
 
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
 
Back
Top