ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting Objects Q (https://www.excelbanter.com/excel-programming/374553-deleting-objects-q.html)

John

Deleting Objects Q
 
I have a piece of code below that deletes all objects within my sheet
"Current". But what I'm finding is that Cell C6 is being deleted and all
cells in this column shift up one. Why would this happen? I have just run
the macro below only, so there is no other influences, but can't understand
why it is happening. If I run it a second time it deletes another row and
again shifts up one cell.

Any help appreciated


Sub ClearMacroButtons()

Sheets("Current").Select
ActiveSheet.DrawingObjects.Select
Selection.Delete
Range("A1").Select
End Sub



John

Deleting Objects Q
 
Prolem solved I was missing "Cells.Select"









"John" wrote in message
...
I have a piece of code below that deletes all objects within my sheet
"Current". But what I'm finding is that Cell C6 is being deleted and all
cells in this column shift up one. Why would this happen? I have just run
the macro below only, so there is no other influences, but can't understand
why it is happening. If I run it a second time it deletes another row and
again shifts up one cell.

Any help appreciated


Sub ClearMacroButtons()

Sheets("Current").Select
ActiveSheet.DrawingObjects.Select
Selection.Delete
Range("A1").Select
End Sub





Ron de Bruin

Deleting Objects Q
 
Hi John

See
http://www.rondebruin.nl/controlsobjectsworksheet.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"John" wrote in message ...
I have a piece of code below that deletes all objects within my sheet "Current". But what I'm finding is that Cell C6 is being
deleted and all cells in this column shift up one. Why would this happen? I have just run the macro below only, so there is no
other influences, but can't understand why it is happening. If I run it a second time it deletes another row and again shifts up
one cell.

Any help appreciated


Sub ClearMacroButtons()

Sheets("Current").Select
ActiveSheet.DrawingObjects.Select
Selection.Delete
Range("A1").Select
End Sub






All times are GMT +1. The time now is 09:06 PM.

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