ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatic Button Delition From Worksheet (https://www.excelbanter.com/excel-programming/316178-automatic-button-delition-worksheet.html)

SPYREN

Automatic Button Delition From Worksheet
 
Greetings,

Can someone tell me how to remove ALL the buttons created in a worksheet
without knowing the assigned number of those buttons when they were created.
The number of buttons in the worksheet always varies.

Thank you in advance for your help.

Dick Kusleika[_4_]

Automatic Button Delition From Worksheet
 
Spyren

Buttons from the Forms toolbar or the Control Toolbox?

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"SPYREN" wrote in message
...
Greetings,

Can someone tell me how to remove ALL the buttons created in a worksheet
without knowing the assigned number of those buttons when they were

created.
The number of buttons in the worksheet always varies.

Thank you in advance for your help.




SPYREN

Automatic Button Delition From Worksheet
 
From the Forms toolbar

"Dick Kusleika" wrote:

Spyren

Buttons from the Forms toolbar or the Control Toolbox?

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"SPYREN" wrote in message
...
Greetings,

Can someone tell me how to remove ALL the buttons created in a worksheet
without knowing the assigned number of those buttons when they were

created.
The number of buttons in the worksheet always varies.

Thank you in advance for your help.





Dick Kusleika[_4_]

Automatic Button Delition From Worksheet
 
Spyren

Sub DelButtons()

Dim btn As Button

For Each btn In Sheet1.Buttons
btn.Delete
Next btn

End Sub

The Button data type is a deprecated object (I think they want you to use
the Shape object), but it's the best for doing this.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"SPYREN" wrote in message
...
From the Forms toolbar

"Dick Kusleika" wrote:

Spyren

Buttons from the Forms toolbar or the Control Toolbox?

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"SPYREN" wrote in message
...
Greetings,

Can someone tell me how to remove ALL the buttons created in a

worksheet
without knowing the assigned number of those buttons when they were

created.
The number of buttons in the worksheet always varies.

Thank you in advance for your help.








All times are GMT +1. The time now is 12:21 AM.

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