Solved

Copy paste as values

Posted on 2016-10-06
4
62 Views
Last Modified: 2016-10-07
I had this question after viewing VBA to copy paste columns form one file to other.

In the VBA soultion have code as below how can i copy paste values to destination sheet

rData.Columns(8).Copy Destination:=oWb.Sheets(1).Cells(11, 13)
            rData.Columns(21).Copy Destination:=oWb.Sheets(1).Cells(11, 5)
            rData.Columns(14).Copy Destination:=oWb.Sheets(1).Cells(11, 4)
            rData.Columns(15).Copy Destination:=oWb.Sheets(1).Cells(11, 2)
            rData.Columns(19).Copy Destination:=oWb.Sheets(1).Cells(11, 3)
            rData.Columns(22).Copy Destination:=oWb.Sheets(1).Cells(11, 6)

Open in new window


I ahve tried

rData.Columns(22).Copy Destination:=oWb.Sheets(1).Cells(11, 6).PasteSpecial Paste:=xlPasteAll

and

rData.Columns(22).Copy Destination:=oWb.Sheets(1).Cells(11, 6).PasteSpecial(xlPasteValues)

Nothing sis work can you please help me out
0
Comment
Question by:Nirvana
  • 2
  • 2
4 Comments
 
LVL 30

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41832491
Try it like this....
rData.Columns(22).Copy
oWb.Sheets(1).Cells(11, 6).PasteSpecial Paste:=xlPasteValues

Open in new window

0
 

Author Comment

by:Nirvana
ID: 41832634
not working sir

rData.Columns(19).Copy oWb.Sheets(1).Cells(11, 3).PasteSpecial Paste:=xlPasteValues
0
 
LVL 30

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41832965
Copy and PasteValues lines should be two different lines not one line.
It must be like below....
rData.Columns(19).Copy 
oWb.Sheets(1).Cells(11, 3).PasteSpecial Paste:=xlPasteValues

Open in new window

0
 

Author Closing Comment

by:Nirvana
ID: 41833203
yes sir realised it have to be in two different lines. sorry for the delay in response. thanks again
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question