Solved

Copy paste as values

Posted on 2016-10-06
4
46 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 28

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 28

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

911 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now