i want to create a reset button so when i press it all the values reset back to zero. this is for a board game and i don't know how to make create this button.![]()
i want to create a reset button so when i press it all the values reset back to zero. this is for a board game and i don't know how to make create this button.![]()
Your new button is ready to use.
- Click on View > Toolbars > Control Toolbox
- Find the Command Button icon and click on it
- Draw a button shape on your sheet with the mouse
- Right-click on the CommandButton1 that results and select Properties
- Find the Caption property in the left panel and change the text in the right panel to RESET GAME
- On the Control Toolbox Toolbar click on the Design Mode icon (this turns off macros temporarily and lets you edit them)
- Right-click on the RESET GAME button and select View Code, the VBEditor will open
- Insert this line of code in empty white space in between the sub flags:
From this code you can see how to list the cells to clear...![]()
Private Sub CommandButton1_Click() Range("A1:A3,B12,D4:G18,H20").ClearContents End Sub
- Edit the cell references to complete the list for your sheet
- Press Alt-Q to close the VBEditor
- Click on the Design Mode icon to revert to normal mode
- Save your sheet
Last edited by JBeaucaire; 04-27-2009 at 09:21 AM.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
thank you so much i finally finished what i had to do. thank you again.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks