Solved

Copy paste as values

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
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…

762 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

21 Experts available now in Live!

Get 1:1 Help Now