ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Paste Special Values (https://www.excelbanter.com/excel-programming/333374-paste-special-values.html)

[email protected]

Paste Special Values
 
Hi NG,
I have this code, which is used to copy a column containing a formula,
and pastes into another sheet.

However, it pastes the formula, but I need it to paste the values, and
I don't know how to modify this code to do it.

This is a code I found on this forum some time ago and it has been very
useful to me.

any help will be greatly appreciated.

Cheers Paul

Sub TotalPriceCopy()

Application.ScreenUpdating = False
Dim wks1 As Worksheet
Dim wks2 As Worksheet
Set wks1 = Workbooks("ClearSaleUpload
Master.xls").Worksheets("IMPUT")
Set wks2 = Workbooks("ClearSaleUpload
Master.xls").Worksheets("ClearSaleUpload")

With wks1
.Range(.Range("G2"), .Range("G2").End(xlDown)).Copy
wks2.Range("G2")
End With

Set wks1 = Nothing
Set wks2 = Nothing
Application.ScreenUpdating = True
End Sub


Norman Jones

Paste Special Values
 
Hi Husky,

Try Changing the followin portion of your code:

With wks1
.Range(.Range("G2"), .Range("G2").End(xlDown)).Copy
wks2.Range("G2")
End With


to:

With wks1
.Range(.Range("G2"), .Range("G2").End(xlDown)).Copy

wks2.Range("G2").PasteSpecial (xlValues)
End With
Application.CutCopyMode = False


---
Regards,
Norman



wrote in message
oups.com...
Hi NG,
I have this code, which is used to copy a column containing a formula,
and pastes into another sheet.

However, it pastes the formula, but I need it to paste the values, and
I don't know how to modify this code to do it.

This is a code I found on this forum some time ago and it has been very
useful to me.

any help will be greatly appreciated.

Cheers Paul

Sub TotalPriceCopy()

Application.ScreenUpdating = False
Dim wks1 As Worksheet
Dim wks2 As Worksheet
Set wks1 = Workbooks("ClearSaleUpload
Master.xls").Worksheets("IMPUT")
Set wks2 = Workbooks("ClearSaleUpload
Master.xls").Worksheets("ClearSaleUpload")

With wks1
.Range(.Range("G2"), .Range("G2").End(xlDown)).Copy
wks2.Range("G2")
End With

Set wks1 = Nothing
Set wks2 = Nothing
Application.ScreenUpdating = True
End Sub




[email protected]

Paste Special Values
 
Hi Norman,
Sorry for not getting back sooner, but that works great.

Thanks for this.

Cheers



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

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