Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run Time Error 2147417848 - 80010108 method Copy of Object Range F | Excel Programming | |||
copy method of object failing | Excel Programming | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Union method for Range Object | Excel Programming | |||
Problem is using any method of Range Object | Excel Programming |