Reset button

Thijmen10

New Member
Joined
Aug 10, 2017
Messages
4
Hello,

I want tot make a calculator in Excel. So i need a reset button to clear everything. But i have some formulas in it aswell. How can i do it?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I have the formula like this:
1 Potato = 4 Euro
Then u put in another cell 10 for 10*4
When i touch the reset button i want that the total cell and the cell where i put 10 in goes empty but the formula stays
 
Upvote 0
Welcome to the forum.

In your CommandButton_click() event, you would use something like this:

Code:
ActiveSheet.Range("B5").Value = ""
ActiveSheet.Range("C6").Value = ""

Now, if the two cells are contiguous, then perhaps this:

Code:
ActiveSheet.Range("B5:C5").Value = ""
 
Last edited:
Upvote 0
Welcome to the forum.

In your CommandButton_click() event, you would use something like this:

Code:
ActiveSheet.Range("B5").Value = ""
ActiveSheet.Range("C6").Value = ""

Now, if the two cells are contiguous, then perhaps this:

Code:
ActiveSheet.Range("B5:C5").Value = ""

Are my formulas staying with those codes?
 
Upvote 0
That depends on what cells the formulas are in. I imagine the cell where you input the 10 is manual input, and then the formula is in the total cell? If that's the case, then just use code for the single cell that will contain the manual input of 10 to clear it out. Then your total cell will recalculate by itself to 0 or potentially a value error. What is the exact formula(s) you are using and what cells are they in? And what specific cells are manual input that should be cleared out when the button is pressed?
 
Upvote 0
That depends on what cells the formulas are in. I imagine the cell where you input the 10 is manual input, and then the formula is in the total cell? If that's the case, then just use code for the single cell that will contain the manual input of 10 to clear it out. Then your total cell will recalculate by itself to 0 or potentially a value error. What is the exact formula(s) you are using and what cells are they in? And what specific cells are manual input that should be cleared out when the button is pressed?
Thanks for helping i think i dont need to send the formulas because its solved. Thanks alot!
 
Upvote 0

Forum statistics

Threads
1,224,787
Messages
6,180,950
Members
453,009
Latest member
lorbieckit

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
Back
Top