ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select (https://www.excelbanter.com/excel-programming/278364-select.html)

PEdro

Select
 
Hi
I have the following code:
ActiveSheet.Shapes("SectorSplit").Select
Selection.Delete

What code should I add in order that if the Shape does not exist it goes to
line2

Best Regards,
Pedro



J.E. McGimpsey

Select
 
One way:

On Error Resume Next
ActiveSheet.Shapes("SectorSplit").Delete
On Error GoTo 0

Goto 0 resets the error handler to the default.

In article ,
"Pedro" wrote:

Hi
I have the following code:
ActiveSheet.Shapes("SectorSplit").Select
Selection.Delete

What code should I add in order that if the Shape does not exist it goes to
line2

Best Regards,
Pedro




All times are GMT +1. The time now is 11:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com