Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does Shape Exist?
Using VBA how can I determine whether a shape (e.g. a rectangle) with a
specific user defined name actually exists before I try to delete it? thanks ... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does Shape Exist?
Hi Alan
You can use a on error On Error Resume Next 'your delete code On Error GoTo 0 -- Regards Ron de Bruin http://www.rondebruin.nl "Alan" wrote in message oups.com... Using VBA how can I determine whether a shape (e.g. a rectangle) with a specific user defined name actually exists before I try to delete it? thanks ... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does Shape Exist?
If you really want to test for its existence, use code like
Dim SH As Shape Set SH = ActiveSheet.Shapes("MyRect") If Not SH Is Nothing Then SH.Delete End If However, it would be simple to attempt to delete the shape and ignore any error that occurs: On Error Resume Next ActiveSheet.Shapes("MyRect").Delete On Error GoTo 0 -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Alan" wrote in message oups.com... Using VBA how can I determine whether a shape (e.g. a rectangle) with a specific user defined name actually exists before I try to delete it? thanks ... |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does Shape Exist?
Thanks guys. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
Copy Worksheet to a new Workbook creating if it doesn't exist and add more Worksheets if it does exist | Excel Programming | |||
Command Line. How to tell to XL : If the xls file exist : Open it, if it does not exist : Create it. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming |