Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default PasteSpecial values pasting formula also??

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default PasteSpecial values pasting formula also??

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
--------------
Jacob Skaria


"Raj" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default PasteSpecial values pasting formula also??

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


On 23 Mar, 07:58, Raj wrote:
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Pasting Values and not Formula David Adamson Excel Discussion (Misc queries) 0 January 15th 09 11:15 PM
key shortcut for PasteSpecial-Values Jarek Kujawa[_2_] Excel Discussion (Misc queries) 1 July 16th 08 01:34 PM
Copy/PasteSpecial Not Pasting all Formatting Eric Weller Excel Programming 3 August 17th 07 03:04 PM
PasteSpecial: values and formats possible in vbs? D. Pirate Roberts Excel Programming 9 October 6th 05 01:08 PM
PasteSpecial Values Patch[_2_] Excel Programming 3 August 16th 04 07:41 PM


All times are GMT +1. The time now is 11:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"