VBA to take result of SUM formula and paste into worksheet

Stu Dapples

Active Member
Joined
Jan 12, 2009
Messages
252
Think I am losing the plot...

Simple - select a cell, copy - selct another cell in a different worksheet, paste.... Easy....

Origin cell has formaula in it (=SUM(A1:A5)

It copies OK but when I paste, I just get #Ref error - it is pasting the formula and not the value (so the cell now contains (=Sum(#Ref))

Tried PasteSpecial, Paste, xlPasteValues - nothing.... Am I missing something?!

Code:

Sheet3.Range("L28").Copy Sheet9.Range("K12").PasteSpecial = xlPasteValues
 
Which line of code is highlighted when you click debug?
Sheet9.Range("K12").PasteSpecial = xlPasteValues
VB.PNG
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
(y)(y)(y)
I can't believe that took me so long!! That's what 5 years without coding will do - maybe time to go back to school....

Thanks Gents, much appreciated as ever
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,225,400
Messages
6,184,758
Members
453,254
Latest member
topeb

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