Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - run-time error PasteSpecial syntax 1

Status
Not open for further replies.

srogers

Technical User
Aug 15, 2000
201
US
Hi-
Does anyone know the correct syntax for a line like this:

Workbooks("202forecast.xls").Worksheets("Period 1").Range("Period1Week1_202").Copy _
Destination:=Workbooks("PeriodXXInProcess.xls").Worksheets("WEEKONE").Range("Week1_202").PasteSpecial(Paste:=xlValues)

I get a 1004 run-time error:
"unable to get the PasteSpecial property of the Range class"

Or perhaps PasteSpecial is not allowed here. It worked before I added that on to the end.

I also tried it without the parenthesis around Paste:=xlValues
Thank you -
 
Hi srogers,

You can't use pastespecial with copy destination; you must do it in two steps ..

.Range("Period1Week1_202").Copy
.Range("Week1_202").PasteSpecial Paste:=xlValues

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top