Copy/Paste Values Only

D

Dan R.

How do I change this to paste the values only? If I
put .PasteSpecial(xlPasteValues) at the end of each it says 'Unable to
get the PasteSpecial property of the Range class'.

SourceRange1.Copy DestRange1
SourceRange2.Copy DestRange2

Thank You,
-- Dan
 
D

Dan R.

It doesnt like the syntax, am I doing something wrong?

Sub Update_Weekly_Report()
Dim SourceRange1 As Range
Dim SourceRange2 As Range
Dim DestRange1 As Range
Dim DestRange2 As Range
Dim WB1 As Worksheet
Dim WB2 As Workbook

Application.ScreenUpdating = False

Set WB1 = ActiveSheet
Set WB2 = Workbooks.Open("A:\CP H6 Lookup.xls")

Set SourceRange1 = WB1.Range("A2:B16")
Set SourceRange2 = WB2.Sheets(13).Range("F3:F17")
Set DestRange1 = WB2.Sheets(13).Range("B3")
Set DestRange2 = WB1.Range("C2")

SourceRange1.Copy DestRange1.PasteSpecial xlPasteValues, , False,
False
SourceRange2.Copy DestRange2.PasteSpecial xlPasteValues, , False,
False

DestRange2.EntireColumn.AutoFit

WB2.Close savechanges:=False
Application.ScreenUpdating = True

End Sub
 
R

Ron de Bruin

Use it like this

SourceRange1.Copy
DestRange1.PasteSpecial xlPasteValues, , False, False
Application.CutCopyMode = False
SourceRange2.Copy
DestRange2.PasteSpecial xlPasteValues, , False, False
Application.CutCopyMode = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top