Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runing two macros triggered by a button | Excel Discussion (Misc queries) | |||
how to create a toolbar button to set selected cells to wrap text | Excel Discussion (Misc queries) | |||
Excel - create button to replace cell content with cell value | Excel Worksheet Functions | |||
how do i create a button within a spreadsheet | Excel Discussion (Misc queries) | |||
Can you create a check box or radio button in Excel? | Excel Discussion (Misc queries) |