#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 83
Default 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.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 83
Default 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.



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command button to clear inputs mbing916 Excel Discussion (Misc queries) 7 April 2nd 07 10:26 PM
Clear Button JudyP Excel Discussion (Misc queries) 2 August 5th 06 08:01 PM
create a clear button jbf frylock Excel Discussion (Misc queries) 9 January 6th 06 11:00 PM
Create a button to Clear Cells tamato43 Excel Discussion (Misc queries) 3 May 16th 05 02:09 AM
Button to clear all entries? Randy Excel Worksheet Functions 2 March 26th 05 05:00 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"