ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Clear Cells Button (https://www.excelbanter.com/excel-discussion-misc-queries/163921-clear-cells-button.html)

Karen Smith

Clear Cells Button
 
How do I make a button to put on a tab that will clear information in
specific cells? ie I want the button to clear (delete) any information in
cells I4, I9, I11.

JE McGimpsey

Clear Cells Button
 
One way:

If you use a button from the Forms toolbar, attach this macro to it
(right-click the button and choose Assign Macro):

Public Sub ClearCells
Range("I4,I0,I11").ClearContents
End Sub


In article ,
Karen Smith wrote:

How do I make a button to put on a tab that will clear information in
specific cells? ie I want the button to clear (delete) any information in
cells I4, I9, I11.


Mike H

Clear Cells Button
 
Hi,

Click

View|Toolbars|Forms to show the forms toolbar then
Click the button tool on the toolbar and put a button on your worksheet

In the window that pops up click NEW and paste this in

Set myrange = Range("I4,I9,I11")
myrange.ClearContents


Mike

"Karen Smith" wrote:

How do I make a button to put on a tab that will clear information in
specific cells? ie I want the button to clear (delete) any information in
cells I4, I9, I11.


Finance Guru

Clear Cells Button
 
I sa your response to this,and I have tried it out - its brilliant. I already
have it working in a large worksheet.

One question though - Having created the button from the forms toolbar,how
can i attached a label to the button. eg "Clear down spredsheet",telling
someone to carry out this action,before updating the worksheet.

It absolutely amazes me the the knowledge out there.
Regards
Finance Guru


"JE McGimpsey" wrote:

One way:

If you use a button from the Forms toolbar, attach this macro to it
(right-click the button and choose Assign Macro):

Public Sub ClearCells
Range("I4,I0,I11").ClearContents
End Sub


In article ,
Karen Smith wrote:

How do I make a button to put on a tab that will clear information in
specific cells? ie I want the button to clear (delete) any information in
cells I4, I9, I11.



Gord Dibben

Clear Cells Button
 
Right-click on the button and edit the text.


Gord Dibben MS Excel MVP

On Mon, 29 Oct 2007 10:02:02 -0700, Finance Guru
wrote:

I sa your response to this,and I have tried it out - its brilliant. I already
have it working in a large worksheet.

One question though - Having created the button from the forms toolbar,how
can i attached a label to the button. eg "Clear down spredsheet",telling
someone to carry out this action,before updating the worksheet.

It absolutely amazes me the the knowledge out there.
Regards
Finance Guru


"JE McGimpsey" wrote:

One way:

If you use a button from the Forms toolbar, attach this macro to it
(right-click the button and choose Assign Macro):

Public Sub ClearCells
Range("I4,I0,I11").ClearContents
End Sub


In article ,
Karen Smith wrote:

How do I make a button to put on a tab that will clear information in
specific cells? ie I want the button to clear (delete) any information in
cells I4, I9, I11.




Finance Guru

Clear Cells Button
 
Thank you Gord. I did try that before emailing the discussion Group,but I
have now tried it again and it works.

Thanks again for help.
FG


"Gord Dibben" wrote:

Right-click on the button and edit the text.


Gord Dibben MS Excel MVP

On Mon, 29 Oct 2007 10:02:02 -0700, Finance Guru
wrote:

I sa your response to this,and I have tried it out - its brilliant. I already
have it working in a large worksheet.

One question though - Having created the button from the forms toolbar,how
can i attached a label to the button. eg "Clear down spredsheet",telling
someone to carry out this action,before updating the worksheet.

It absolutely amazes me the the knowledge out there.
Regards
Finance Guru


"JE McGimpsey" wrote:

One way:

If you use a button from the Forms toolbar, attach this macro to it
(right-click the button and choose Assign Macro):

Public Sub ClearCells
Range("I4,I0,I11").ClearContents
End Sub


In article ,
Karen Smith wrote:

How do I make a button to put on a tab that will clear information in
specific cells? ie I want the button to clear (delete) any information in
cells I4, I9, I11.




Qiang Huang

create a button to clear cells in multiple sheets
 
Hi,

This macro works great, but how can I create a single button to clear cells for multiple sheets?

For example, I want to clear cells G6:G25 in sheet 1, sheet 2, and sheet 3 with just one click of a button.

Please let me know when you have a chance.

Thanks,

Cuong




EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com

JE McGimpsey

create a button to clear cells in multiple sheets
 
One way:

Public Sub ClearRangeInThreeSheets()
Const csCellRef As String = "G6:G25"
Dim ws As Worksheet
For Each ws In Worksheets(Array("Sheet 1", "Sheet 2", "Sheet 3"))
ws.Range(csCellRef).ClearContents
Next ws
End Sub



In article , Qiang Huang wrote:

For example, I want to clear cells G6:G25 in sheet 1, sheet 2, and sheet 3
with just one click of a button.



All times are GMT +1. The time now is 03:48 PM.

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