Clearing Contents in certain cells

markerd

New Member
Joined
Mar 8, 2004
Messages
3
Hi,
Is it possible to clear details from certain cells in a worksheet. I have set up a worksheet for children to fill in the missing answers in a number of random cells. If I want another child to use the worksheet I have to manually delete the previous answers before another child can have a go.
Can this be done?
Thanks
markerd
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

tabjill

New Member
Joined
May 22, 2003
Messages
2
Create a macro of the actions and assign a toolbar button to clear it for you.

To create a macro...
Go to tools
Macro
Record New Macro
Give it a name
Now complete your actions (clearing contents of the specific cells)
Click Stop Recording when you are done

To assign macro to a toolbar...
Go to tools
Customize
Commands
Highlight Macros on the left
Drag Custom Button and drop it on a toolbar
Do not click Close yet
Right Click on the button
Choose Assign Macro
Highlight your macro and click ok
Now you can close the customize box

Now each time you want to clear the contents of those cells, you can just click your custom button.
 

Greg Truby

MrExcel MVP
Joined
Jun 19, 2002
Messages
10,022
How do you know that a new child is using the worksheet? Are they entering their names somewhere? Or are you overseeing their usage and you will be the person doing the clearing each time? If the child is entering the name (typing or picking from a list) then you may indeed find that you prefer a macro-based solution.

If you are going to be there, then you might just want a quick way to do this manually? Personally, I would <ul>[*]Select (highlight) all of the cells you want to clear by holding down the Ctrl key and clicking on them (or hit Shift+F8 to go into "Add mode"). [*]Once you have all the cells selected, type in a new name in the Name Box that's found on the left end of the formula bar, giving it a name like DeleteRange[*]Then any time you want to clear the cells, just pick DeleteRange in the Name Box dropdown list and hit your Delete key[/list]Then if you later decide that you do want to automate this via a button or using some type of Event Handler, your macro would only consist of one line of code:
[DeleteRange].ClearContents

HTH
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,100
Messages
5,768,095
Members
425,452
Latest member
htay44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top