# Calculate total at a press of a button

#### Boycee

##### Board Regular
I have a formula in cell L23 =SUM(D15*E20+E22)

This will change total everytime one of the cells in the formula is altered.

What I would like to do is for the formula to only calculate the total at a press of a button.

So if D15 was change the total would remain the same until the button (linked to a macro) was pressed and then L23 would show the new correct total.

Can anyone help, is this possible.

### Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

#### fairwinds

##### MrExcel MVP
Hi,

Use this as code and asign a button to it.

Code:
``````Sub xxx()
Range("L23") = Range("D15") * Range("E20") + Range("E22")
End Sub``````

Replies
1
Views
102
Replies
1
Views
103
Replies
3
Views
288
Replies
3
Views
87
Replies
2
Views
498

1,186,173
Messages
5,956,366
Members
438,248
Latest member
Poysenberries

### 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.

### Which adblocker are you using?

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

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