PC Review


Reply
Thread Tools Rate Thread

Copy and PasteSpecial help

 
 
=?Utf-8?B?Y2hlbWljYWxz?=
Guest
Posts: n/a
 
      9th Nov 2006

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?
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      9th Nov 2006
try

with range("c15:bk15")
..value=.formula
end with
--
Don Guillett
SalesAid Software
(E-Mail Removed)
"chemicals" <(E-Mail Removed)> wrote in message
news:0AF46404-A1C4-4CD4-96F4-(E-Mail Removed)...
>
> 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?



 
Reply With Quote
 
=?Utf-8?B?Q2FybG9z?=
Guest
Posts: n/a
 
      9th Nov 2006
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?

 
Reply With Quote
 
=?Utf-8?B?Y2hlbWljYWxz?=
Guest
Posts: n/a
 
      9th Nov 2006
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?

 
Reply With Quote
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      9th Nov 2006
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?

 
Reply With Quote
 
=?Utf-8?B?Q2FybG9z?=
Guest
Posts: n/a
 
      9th Nov 2006
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
> (E-Mail Removed)
> "chemicals" <(E-Mail Removed)> wrote in message
> news:0AF46404-A1C4-4CD4-96F4-(E-Mail Removed)...
> >
> > 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?

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy/pastespecial error =?Utf-8?B?Sm9u?= Microsoft Excel Programming 5 29th Oct 2007 12:59 PM
.Copy Destination:= .PasteSpecial ??? =?Utf-8?B?bXlCYXNpYw==?= Microsoft Excel Programming 2 12th Nov 2004 10:11 AM
Copy PasteSpecial Rob van Gelder Microsoft Excel Programming 1 28th Jul 2004 07:59 AM
Copy & PasteSpecial Arthur Microsoft Excel Programming 1 3rd Nov 2003 06:41 PM
Copy and pastespecial without formulas Steven Cheng Microsoft Excel Programming 2 26th Jul 2003 08:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:10 AM.