ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How To Copy Sum of Cell Values vs A Single Cell Value (https://www.excelbanter.com/excel-programming/296029-how-copy-sum-cell-values-vs-single-cell-value.html)

Mike Taylor

How To Copy Sum of Cell Values vs A Single Cell Value
 
The code below copies the value of cell d8 from one worksheet and
pastes the value and format of that cell into column M of a different
worksheet ("DestSh"). What is the code that would copy the sum of
cells d8:d10 rather than only the value in cell d8?

sh.Range("d8").Copy
With DestSh.Cells(Last + 1, "m")
.PasteSpecial xlPasteValues, , False, False
.PasteSpecial xlPasteFormats, , False, False
Application.CutCopyMode = False
End With

Thanks in advance for any feedback...
Mike Taylor

Chris

How To Copy Sum of Cell Values vs A Single Cell Value
 
sh.Range("d8").Cop
Set MyRange = Range("d8:d10"
With DestSh.Cells(Last + 1, "m")
.PasteSpecial xlPasteFormats
.Value = Application.WorksheetFunction.Sum(MyRange)
End Wit
----- Mike Taylor wrote: ----

The code below copies the value of cell d8 from one worksheet an
pastes the value and format of that cell into column M of a differen
worksheet ("DestSh"). What is the code that would copy the sum o
cells d8:d10 rather than only the value in cell d8

sh.Range("d8").Cop
With DestSh.Cells(Last + 1, "m"
.PasteSpecial xlPasteValues, , False, Fals
.PasteSpecial xlPasteFormats, , False, Fals
Application.CutCopyMode = Fals
End Wit

Thanks in advance for any feedback..
Mike Taylo


Mike Taylor

Would someone please offer help?
 
Would someone be kind enough to offer a suggestion to my earlier
post...I've searched the postings and not been able to figure this one
out...TIA
Mike

(Mike Taylor) wrote in message . com...
The code below copies the value of cell d8 from one worksheet and
pastes the value and format of that cell into column M of a different
worksheet ("DestSh"). What is the code that would copy the sum of
cells d8:d10 rather than only the value in cell d8?

sh.Range("d8").Copy
With DestSh.Cells(Last + 1, "m")
.PasteSpecial xlPasteValues, , False, False
.PasteSpecial xlPasteFormats, , False, False
Application.CutCopyMode = False
End With

Thanks in advance for any feedback...
Mike Taylor


Earl Kiosterud[_3_]

Would someone please offer help?
 
Mike,

Sheets("DestSh").Range("D4") =
Application.WorksheetFunction.Sum(Sheets("Sh").Ran ge("D8:D10"))

Or
Sheets("DestSh").Range("D4") = Sheets("DestSh").range("D8") + _
Sheets("DestSh").range("D9") + _
Sheets("DestSh").range("D10")

I've put it in D4. You can apply your own magic.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Mike Taylor" wrote in message
om...
Would someone be kind enough to offer a suggestion to my earlier
post...I've searched the postings and not been able to figure this one
out...TIA
Mike

(Mike Taylor) wrote in message

. com...
The code below copies the value of cell d8 from one worksheet and
pastes the value and format of that cell into column M of a different
worksheet ("DestSh"). What is the code that would copy the sum of
cells d8:d10 rather than only the value in cell d8?

sh.Range("d8").Copy
With DestSh.Cells(Last + 1, "m")
.PasteSpecial xlPasteValues, , False, False
.PasteSpecial xlPasteFormats, , False, False
Application.CutCopyMode = False
End With

Thanks in advance for any feedback...
Mike Taylor





All times are GMT +1. The time now is 03:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com