ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy and PasteSpecial help (https://www.excelbanter.com/excel-programming/377127-copy-pastespecial-help.html)

chemicals

Copy and PasteSpecial help
 

I have simple code:

Sheets("DW").Range("C15:BK15").Copy
Sheets("DW").Range("C11").PasteSpecial(xlValues)

I get the follwoing error:

Error 1004
Unable to get the PasteSpecial property of the Range class

What gives?

Don Guillett

Copy and PasteSpecial help
 
try

with range("c15:bk15")
..value=.formula
end with
--
Don Guillett
SalesAid Software

"chemicals" wrote in message
...

I have simple code:

Sheets("DW").Range("C15:BK15").Copy
Sheets("DW").Range("C11").PasteSpecial(xlValues)

I get the follwoing error:

Error 1004
Unable to get the PasteSpecial property of the Range class

What gives?




Carlos

Copy and PasteSpecial help
 
Try this one.

Option Explicit
Public Sub PasteSpecial()
Dim ws As String
Dim from As Range
Dim destination As Range
ws = "DW"

With Worksheets(ws)
Set from = .Range("A2:A5")
Set destination = .Range("B2")
Call from.Copy
Call destination.PasteSpecial(xlPasteValues)
End With

End Sub


--
Carlos


"chemicals" wrote:


I have simple code:

Sheets("DW").Range("C15:BK15").Copy
Sheets("DW").Range("C11").PasteSpecial(xlValues)

I get the follwoing error:

Error 1004
Unable to get the PasteSpecial property of the Range class

What gives?


chemicals

Copy and PasteSpecial help
 
I have solved it with this workaround...but woudlstill like to know what my
original problem was

Sheets("DW").Range("C11:BK11").Value =
Sheets("DW").Range("C15:BK15").Value


"chemicals" wrote:


I have simple code:

Sheets("DW").Range("C15:BK15").Copy
Sheets("DW").Range("C11").PasteSpecial(xlValues)

I get the follwoing error:

Error 1004
Unable to get the PasteSpecial property of the Range class

What gives?


Jim Thomlinson

Copy and PasteSpecial help
 
I am guessing that that line of code was all on one line? That would cause
the problem. PasteSpecial code goes on 2 lines... something like this...

Sheets("DW").Range("C15:BK15").Copy
Sheets("DW").Range("C11").PasteSpecial xlValues
Application.CutCopyMode = False
--
HTH...

Jim Thomlinson


"chemicals" wrote:


I have simple code:

Sheets("DW").Range("C15:BK15").Copy
Sheets("DW").Range("C11").PasteSpecial(xlValues)

I get the follwoing error:

Error 1004
Unable to get the PasteSpecial property of the Range class

What gives?


Carlos

Copy and PasteSpecial help
 
Try this one,

Option Explicit
Public Sub PasteSpecial()
Dim ws As String
Dim from As Range
Dim destination As Range
ws = "DW"

With Worksheets(ws)
Set from = .Range("A2:A5")
Set destination = .Range("B2")
Call from.Copy
Call destination.PasteSpecial(xlPasteValues)
End With

End Sub

--
Carlos


"Don Guillett" wrote:

try

with range("c15:bk15")
..value=.formula
end with
--
Don Guillett
SalesAid Software

"chemicals" wrote in message
...

I have simple code:

Sheets("DW").Range("C15:BK15").Copy
Sheets("DW").Range("C11").PasteSpecial(xlValues)

I get the follwoing error:

Error 1004
Unable to get the PasteSpecial property of the Range class

What gives?






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

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