Having Code Store SUM Function into Particular Cell on sheet Copy

USFengBULLS

Board Regular
Joined
May 7, 2018
Messages
66
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a procedure that makes a copy of a sheet that on the new sheet I do not want it to copy the embeded formulas, just the values, which works fine.
But, I do need it to have one cell in particular, Range("D7"), to have this formula in it =SUM(D4:D6) in case the user has the need to come back to this particular Change Order and adjust the cost for this Change Order it reflects in the Total Cell Range ("D7"). Here is the code so far:


Sheets("NEW FORM-RESET").Select
Sheets("NEW FORM-RESET").Copy After:=Sheets(3)
Sheets("NEW FORM-RESET (2)").Select
Sheets("NEW FORM-RESET (2)").Name = CO_Number
ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
Range("D7") = Application.WorksheetFunction.SUM(Range("D4:D6"))

Notice I use the Application.WorksheetFunction.Sum for this but it of course only runs this sum once which does not satisfy say the user comes back in a week from to this sheet and need to make an adjustment to costs. How can I write it where it is like the excel formula =SUM(D4:D6) or even =(D4+D5+D6)?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,214,596
Messages
6,120,438
Members
448,966
Latest member
DannyC96

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