Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jbf frylock
 
Posts: n/a
Default create a clear button

I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff
  #2   Report Post  
Posted to microsoft.public.excel.misc
L. Howard Kittle
 
Posts: n/a
Default create a clear button

Hi Jeff,

Pretty straignt forward.

Sub ClearIt()
Range("A3:A7,A10,D3:D7,G3:G7").ClearContents
End Sub

Copy and paste in the sheet module(View Code) and then make your button from
the forms tool bar and assign the macro to the button.

HTH
Regards,
Howard

"jbf frylock" wrote in message
...
I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff



  #3   Report Post  
Posted to microsoft.public.excel.misc
Elkar
 
Posts: n/a
Default create a clear button

Rather than writing your own code, I'd suggest using the Macro Recorder for
this.

1. Select TOOLS
2. Select MACROS
3. Select RECORD NEW MACRO...
4. Give the Macro a name (or just use the default)
5. Select your cells (hold down the Ctrl key to select multiple non-adjacent
cells)
6. Hit DELETE on your keyboard
7. Select a cell where you want the focus to be after cells are cleared.
(perhaps A3?)
8. Stop recording the macro
9. If you've already placed the button on your sheet, then right-click it
and select "Assign Macro"
10. If not, place the button and assign the Macro.

Post back if you need more assistance.

HTH,
Elkar

"jbf frylock" wrote:

I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff

  #4   Report Post  
Posted to microsoft.public.excel.misc
jbf frylock
 
Posts: n/a
Default create a clear button

Thanks, but when I right click it doesn't give me the option to assign macros.

"Elkar" wrote:

Rather than writing your own code, I'd suggest using the Macro Recorder for
this.

1. Select TOOLS
2. Select MACROS
3. Select RECORD NEW MACRO...
4. Give the Macro a name (or just use the default)
5. Select your cells (hold down the Ctrl key to select multiple non-adjacent
cells)
6. Hit DELETE on your keyboard
7. Select a cell where you want the focus to be after cells are cleared.
(perhaps A3?)
8. Stop recording the macro
9. If you've already placed the button on your sheet, then right-click it
and select "Assign Macro"
10. If not, place the button and assign the Macro.

Post back if you need more assistance.

HTH,
Elkar

"jbf frylock" wrote:

I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff

  #5   Report Post  
Posted to microsoft.public.excel.misc
jbf frylock
 
Posts: n/a
Default create a clear button

Thanks for the response...

How do I assign the macros? When I right click it doesn't give me the
option.

"L. Howard Kittle" wrote:

Hi Jeff,

Pretty straignt forward.

Sub ClearIt()
Range("A3:A7,A10,D3:D7,G3:G7").ClearContents
End Sub

Copy and paste in the sheet module(View Code) and then make your button from
the forms tool bar and assign the macro to the button.

HTH
Regards,
Howard

"jbf frylock" wrote in message
...
I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff






  #6   Report Post  
Posted to microsoft.public.excel.misc
L. Howard Kittle
 
Posts: n/a
Default create a clear button

Thanks, but when I right click it doesn't give me the option to assign
macros.


Use a button from the Forms toolbar.

View ToolBars check Forms

Now make your button from that tool bar using the button icon.

HTH
Regards,
Howard

"jbf frylock" wrote in message
...
I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff



  #7   Report Post  
Posted to microsoft.public.excel.misc
L. Howard Kittle
 
Posts: n/a
Default create a clear button

See my last response, the 2:00PM one.

"jbf frylock" wrote in message
...
Thanks for the response...

How do I assign the macros? When I right click it doesn't give me the
option.

"L. Howard Kittle" wrote:

Hi Jeff,

Pretty straignt forward.

Sub ClearIt()
Range("A3:A7,A10,D3:D7,G3:G7").ClearContents
End Sub

Copy and paste in the sheet module(View Code) and then make your button
from
the forms tool bar and assign the macro to the button.

HTH
Regards,
Howard

"jbf frylock" wrote in message
...
I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff






  #8   Report Post  
Posted to microsoft.public.excel.misc
jbf frylock
 
Posts: n/a
Default create a clear button

Thank you so much. Amazing how quickly it works when done correctly.

"L. Howard Kittle" wrote:

Thanks, but when I right click it doesn't give me the option to assign
macros.


Use a button from the Forms toolbar.

View ToolBars check Forms

Now make your button from that tool bar using the button icon.

HTH
Regards,
Howard

"jbf frylock" wrote in message
...
I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff




  #9   Report Post  
Posted to microsoft.public.excel.misc
L. Howard Kittle
 
Posts: n/a
Default create a clear button

Your welcome, and you will be catching on the more you do.

"jbf frylock" wrote in message
...
Thank you so much. Amazing how quickly it works when done correctly.

"L. Howard Kittle" wrote:

Thanks, but when I right click it doesn't give me the option to assign
macros.


Use a button from the Forms toolbar.

View ToolBars check Forms

Now make your button from that tool bar using the button icon.

HTH
Regards,
Howard

"jbf frylock" wrote in message
...
I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff






  #10   Report Post  
Posted to microsoft.public.excel.misc
Sloth
 
Posts: n/a
Default create a clear button

He skipped a step.

8 1/2. Right click the button and hit Customize

This will put you in the mode were you can customize the menu area. You can
actually right click anywhere in the menu area.

"jbf frylock" wrote:

Thanks, but when I right click it doesn't give me the option to assign macros.

"Elkar" wrote:

Rather than writing your own code, I'd suggest using the Macro Recorder for
this.

1. Select TOOLS
2. Select MACROS
3. Select RECORD NEW MACRO...
4. Give the Macro a name (or just use the default)
5. Select your cells (hold down the Ctrl key to select multiple non-adjacent
cells)
6. Hit DELETE on your keyboard
7. Select a cell where you want the focus to be after cells are cleared.
(perhaps A3?)
8. Stop recording the macro
9. If you've already placed the button on your sheet, then right-click it
and select "Assign Macro"
10. If not, place the button and assign the Macro.

Post back if you need more assistance.

HTH,
Elkar

"jbf frylock" wrote:

I've read some of the other on here and can't get it to work.

I have cells A3:A7,A10,D3:D7,G3:G7

I want the values in these cells to be deleted when I click a Clear All
button.

So, do I create the button, go to view code and enter it there. I
specifically need help with the code.

Any help would be great...thanks,

Jeff

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
Runing two macros triggered by a button Dave Peterson Excel Discussion (Misc queries) 0 December 9th 05 12:43 AM
how to create a toolbar button to set selected cells to wrap text steveguebert Excel Discussion (Misc queries) 1 December 9th 05 12:34 AM
Excel - create button to replace cell content with cell value blackmot Excel Worksheet Functions 3 December 7th 05 05:10 PM
how do i create a button within a spreadsheet Brian Excel Discussion (Misc queries) 1 July 13th 05 03:12 AM
Can you create a check box or radio button in Excel? sf49ers Excel Discussion (Misc queries) 2 January 5th 05 03:31 PM


All times are GMT +1. The time now is 10:28 AM.

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

About Us

"It's about Microsoft Excel"