PC Review


Reply
Thread Tools Rate Thread

copy method of range object

 
 
Peter
Guest
Posts: n/a
 
      25th Sep 2008
i have this line which copies and pastes in the one statement:

Sheets("AUS-SA_AgeGrp4M").Range("a1:aq" & LRow).Copy
Destination:=Sheets("Sheet2").Cells(1, LCol + 1)

could someone pls suggest what the code would look like to make it paste as
paste special?

--
Peter
 
Reply With Quote
 
 
 
 
Bob Bridges
Guest
Posts: n/a
 
      25th Sep 2008
Oh, wait, I did this once. Um...here it is. It depends on what special sort
of paste you want to do; if you just want Paste Values, for instance, do it
like this:

Sheets("AUS-SA_AgeGrp4M").Range("a1:aq" & LRow).Copy
Sheets("Sheet2").Cells(1, LCol + 1).PasteSpecial Paste := xlPasteValues

But you can control the other options, too: comments, all-except-borders,
the arithmetic operations, transpose, all that stuff. If you don't already
know where to find the .chm file for VBA/Excel on your machine, it's past
time you found it, created a link to it and brought it up whenever you have
to code: It makes it a lot easier to find stuff like this. Let me know if
this is a mystery to you and I'll give you some pointers; it's an invaluable
documentation guide, much easier to use than your VBE Help option (in my
opinion).

--- "Peter" wrote:
> i have this line which copies and pastes in the one statement:
>
> Sheets("AUS-SA_AgeGrp4M").Range("a1:aq" & LRow).Copy _
> Destination:=Sheets("Sheet2").Cells(1, LCol + 1)
>
> could someone pls suggest what the code would look like to make it paste as
> paste special?

 
Reply With Quote
 
Peter
Guest
Posts: n/a
 
      25th Sep 2008
hey bob.
you saved my arse mate!!!
thanks so much.
i am so bad at trying to learn this language.
re
If you don't already
know where to find the .chm file for VBA/Excel on your machine, it's past
time you found it, --

......ys pls!

Peter


"Bob Bridges" wrote:

> Oh, wait, I did this once. Um...here it is. It depends on what special sort
> of paste you want to do; if you just want Paste Values, for instance, do it
> like this:
>
> Sheets("AUS-SA_AgeGrp4M").Range("a1:aq" & LRow).Copy
> Sheets("Sheet2").Cells(1, LCol + 1).PasteSpecial Paste := xlPasteValues
>
> But you can control the other options, too: comments, all-except-borders,
> the arithmetic operations, transpose, all that stuff. If you don't already
> know where to find the .chm file for VBA/Excel on your machine, it's past
> time you found it, created a link to it and brought it up whenever you have
> to code: It makes it a lot easier to find stuff like this. Let me know if
> this is a mystery to you and I'll give you some pointers; it's an invaluable
> documentation guide, much easier to use than your VBE Help option (in my
> opinion).
>
> --- "Peter" wrote:
> > i have this line which copies and pastes in the one statement:
> >
> > Sheets("AUS-SA_AgeGrp4M").Range("a1:aq" & LRow).Copy _
> > Destination:=Sheets("Sheet2").Cells(1, LCol + 1)
> >
> > could someone pls suggest what the code would look like to make it paste as
> > paste special?

 
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
Using the Find method of a Range object JAC Microsoft Excel Programming 2 10th Sep 2010 08:09 AM
Run Time Error 2147417848 - 80010108 method Copy of Object Range F =?Utf-8?B?Um9uS2F5?= Microsoft Excel Programming 1 19th Oct 2007 06:36 AM
Range Question / error 1004: method Range of object Worksheet has failed Paul Microsoft Excel Programming 3 7th Apr 2005 02:56 PM
Union method for Range Object =?Utf-8?B?Q2hhZA==?= Microsoft Excel Programming 5 10th Mar 2005 08:02 PM
Adding named range gives error "method range of object _Global failed " Gunnar Johansson Microsoft Excel Programming 3 10th Aug 2004 01:54 PM


Features
 

Advertising
 

Newsgroups
 


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