ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy font...not formatting (https://www.excelbanter.com/excel-programming/298280-copy-font-not-formatting.html)

Geoff[_9_]

copy font...not formatting
 
Hello

My knowledge is limited so i am seeking the help of a more intelligent person who can play with the code below so that it copies the values in the cells and not formulas, formatting, etc.....just the text and numbers????

Thanks all!

Sub CopyData(
Dim wsFedex As Workshee
Dim wsSummary As Workshee

Set wsFedex = Worksheets("FEDEX calculator"
Set wsSummary = Worksheets("summary"

With wsFede
wsSummary.Rows(19).Inser
.Range("A19:E19").Copy Destination:=wsSummary.Cells(19, "A"
.Range("H19:J19").Copy Destination:=wsSummary.Cells(19, "F"
End Wit

End Su


Nigel[_8_]

copy font...not formatting
 
To my knowledge you cannot copy-paste special to a destination in one go, so
try this

With wsFedex
wsSummary.Rows(19).Insert
.Range("A19:E19").Copy
wsSummary.cells(19,"A").PasteSpecial Paste:=xlPasteValues
.Range("H19:J19").Copy
wsSummary.cells(19,"F").PasteSpecial Paste:=xlPasteValues
End With

Cheers
Nigel


"Geoff" wrote in message
...
Hello,

My knowledge is limited so i am seeking the help of a more intelligent

person who can play with the code below so that it copies the values in the
cells and not formulas, formatting, etc.....just the text and numbers????

Thanks all!!

Sub CopyData()
Dim wsFedex As Worksheet
Dim wsSummary As Worksheet

Set wsFedex = Worksheets("FEDEX calculator")
Set wsSummary = Worksheets("summary")

With wsFedex
wsSummary.Rows(19).Insert
.Range("A19:E19").Copy Destination:=wsSummary.Cells(19, "A")
.Range("H19:J19").Copy Destination:=wsSummary.Cells(19, "F")
End With

End Sub




gavmer[_3_]

copy font...not formatting
 
Thanks so much...exact!!!

Can you amend, possibly with an offset. I am using a sum function an
it is moving the range down???

Cheers!!!!

--
Message posted from http://www.ExcelForum.com


Nigel[_8_]

copy font...not formatting
 
The ranges shown are absolute so what offset are you trying to apply ?
Sounds like you might need to change the destination range to row 20 ?

Cheers
Nigel

"gavmer " wrote in message
...
Thanks so much...exact!!!

Can you amend, possibly with an offset. I am using a sum function and
it is moving the range down???

Cheers!!!!!


---
Message posted from http://www.ExcelForum.com/




gavmer[_4_]

copy font...not formatting
 
destination 20....worked like a charm.

Cheers!!!!!!

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 02:12 AM.

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