PasteSpecial values pasting formula also??

R

Raj

Hi

I am using the following code to copy from the InputData sheet of one
workbook and paste only values to the rspPlan sheet of another
workbook:

InputData.Range("d54:D73").Copy
rspPlan.Activate: rspPlan.Range("w180:w199").Select:
Selection.PasteSpecial Paste:=xlPasteValues

The source range has formulae in all the cells, but values only in a
few. The code is however pasting the formulae also. I want only values
to be pasted.

What will be the code to do this?

Also, is there a better way/code?

Thanks in advance for the help.

Raj
 
J

Jacob Skaria

Dear Raj

Your code looks fine. Could you please check whether there is any formula in
the second sheet before copying.

Worksheets("InputData").Range("B1:B23").Copy
Worksheets("RspPlan").Range("C1:C25").Select
Selection.PasteSpecial Paste:=xlPasteValues
Worksheets("InputData").Activate
Application.CutCopyMode = False


If this post helps click Yes
 
J

Jarek Kujawa

to the code is OK

but it might be made briefer cause you don't have to select a range to
paste data into it. nor you have to activate a particular worksheet to
do it

InputData.Range("d54:D73").Copy
rspPlan.Range("w180:w199").PasteSpecial Paste:=xlPasteValues

would do the same
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top