ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Buttons (https://www.excelbanter.com/excel-worksheet-functions/9647-buttons.html)

Atlanta Rudy

Buttons
 
Hi all,

I want to have a button clear the contents of a list of cells. Can anyone
help me?

Thanks,

Rudy

Harald Staff

Hi Rudy

Assign a macro like this to the thing:

Sub ClearMyArea()
Sheets(1).Range("A2:C14").ClearContents
End Sub

HTH. Best wishes Harald

"Atlanta Rudy" skrev i melding
...
Hi all,

I want to have a button clear the contents of a list of cells. Can anyone
help me?

Thanks,

Rudy




Ola

Sure, Excel has a Icon button just for that!

Here is how to get it:
Right click on your Icon bar in Excel. Choose Customize... (at the bottom of
the list).
Select tab 'Commands'. Select 'Edit' under Catagories. Now scroll down under
Commands until you find the button 'Clear Contentes' (looks like an eraser).
Drag and Drop it in your Excel Icon bar.

Done!

Ola Sandstrom


keepITcool


Rudy

maybe simpler than writing your own macro is to use a standard menu
button.

Right click toolbars
Select Customize
Select 2nd tab
Select Edit category
Search for the ClearContents item and drag it to a toolbar.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Harald Staff wrote :

Hi Rudy

Assign a macro like this to the thing:

Sub ClearMyArea()
Sheets(1).Range("A2:C14").ClearContents
End Sub

HTH. Best wishes Harald

"Atlanta Rudy" skrev i melding
...
Hi all,

I want to have a button clear the contents of a list of cells. Can
anyone help me?

Thanks,

Rudy



All times are GMT +1. The time now is 05:08 PM.

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