Solved

Copy paste as values

Posted on 2016-10-06
4
66 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 31

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 31

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

739 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