![]() |
Selecing a picture in VBA
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 |
Selecing a picture in VBA
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 -- Regards, Jake Marx www.longhead.com PaulS wrote: 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 |
Selecing a picture in VBA
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 -----Original Message----- 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 -- Regards, Jake Marx www.longhead.com PaulS wrote: 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 . |
All times are GMT +1. The time now is 01:59 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com