ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Object, not Working Correctly (https://www.excelbanter.com/excel-programming/450725-delete-object-not-working-correctly.html)

[email protected]

Delete Object, not Working Correctly
 
Could anyone tell me why the code below "Deletes A1 and moves the cells up 1"?

I'm at a loss to know why this is happening. Firstly I searched to see if there are any object on sheet (Find-Go to Spectal-Objects) and there aren't any, I run the code below anyway and above happens (which has the effect of distorting the layout of my sheet). I would except if no objects, it doesn't do anything


Sub ClearObjects()
Application.ScreenUpdating = False

Sheets("Sheet1").Visible = True
Sheets("Sheet1").Select
ActiveSheet.DrawingObjects.Select
Selection.Delete
Range("A1").Select

End Sub

Claus Busch

Delete Object, not Working Correctly
 
Hi,

Am Sun, 22 Mar 2015 13:03:55 -0700 (PDT) schrieb :

I'm at a loss to know why this is happening. Firstly I searched to see if there are any object on sheet (Find-Go to Spectal-Objects) and there aren't any, I run the code below anyway and above happens (which has the effect of distorting the layout of my sheet). I would except if no objects, it doesn't do anything


try:

Sub Test()
With Sheets("Sheet1")
.Visible = True
.DrawingObjects.Delete
End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


All times are GMT +1. The time now is 03:01 AM.

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