# Creating a reset button in Excel



## robj (Jul 5, 2003)

I have a simple s/sheet containing basic formulae for introducing the concept of modellng to young pupils.
How do I create a "Reset" button so that after entering/changing variables the s/sheet can be quickly put back to the starting position? (ie not using the undo icon continually!)


----------



## mrwendal (Jul 25, 2001)

Probably one of the quickest and simplest ways is to record a macro under the Tools option.

Click on record new macro and then delete the contents of all cells that have entries that you don't want to keep.

You can then attach this macro to a button on the spreadsheet, or even put a button on the toolbar and whenever you wish to revert back, just click the button!

Does this make sense - or have i got the wrong end of the stick?

Mind you, this will only work if the same cells are being deleted each time.


----------



## robj (Jul 5, 2003)

Thanks for reply.
I guessed I'd need a macro (haven't done them yet, but now's the time to learn!).

Possible problem is that different info will be added each time so won't be able to determine in advance what content will need to be deleted. The macro will need to "tell Excel" to go back to its "start position" irrespective of what has ben done to it; and withkids that could be quite a lot!


----------



## mrwendal (Jul 25, 2001)

Well, maybe the answer is not to record a macro to 'undo' everything.

Perhaps the answer should be to create a macro to 'create' the defaults you want to see.

For example, with a blank worksheet, click on Tools, then Macros and then Record Macro.

First off, you would want to delete everything (don't worry, I know nothing is there!), so click the 'Select All' button (little square located left of the 'A' and above the '1').

With the macro still recording, press Edit, then Clear and then All, to delete the contents of all the cells in question.

Proceed to fill in the cells with the default formulae, etc, that you want to see each time at the start.

Once you are happy with this, click on the 'Stop Recording Macro' button.

--

Now to add a button to your menu (if you want to that is!)

Right click on the toolbar (next to Help, etc) and select Customize.
On the Commands tab that appears, select Macro in the left-hand window and drag the Custom Button icon to where you want it on the toolbar.

Once this has been done, right-click on your new menu item and select Assign Macro. Choose the macro you just created from the list that appears and close the customize window.

Now, each time a pupil has done their worst (!), all you have to do is click on your new button and it will reset the form to how you set it up first time round!

---

Hope this is what you are after.....


----------



## robj (Jul 5, 2003)

Just seen your post - sounds just the job! Too late to try tonight, but will PM you with the good/bad news! Cheers.


----------

