Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Paste values only

I am trying to write code to paste the contents of a range of cells on sheet
1 to a range of cells on sheet 2 but all it is pasting is a #REF error. I
assume this is becuase it is pasting the formula in the cells on sheet 1 and
not the values only. Is their a pasteSpecial method to paste teh values of
the cells only?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Paste values only

Here's the line to add once you have selected where you want to paste.

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

"GLHEC-BLS" wrote:

I am trying to write code to paste the contents of a range of cells on sheet
1 to a range of cells on sheet 2 but all it is pasting is a #REF error. I
assume this is becuase it is pasting the formula in the cells on sheet 1 and
not the values only. Is their a pasteSpecial method to paste teh values of
the cells only?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Paste values only

Sub Macro1()
Range("A1:D7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

right from the recorder
--
Gary''s Student - gsnu200813


"GLHEC-BLS" wrote:

I am trying to write code to paste the contents of a range of cells on sheet
1 to a range of cells on sheet 2 but all it is pasting is a #REF error. I
assume this is becuase it is pasting the formula in the cells on sheet 1 and
not the values only. Is their a pasteSpecial method to paste teh values of
the cells only?

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
Change paste to only paste values Chris Trygstad Excel Programming 1 November 6th 08 08:07 PM
find values in multiple cells and paste row values izzyt1972 Excel Discussion (Misc queries) 5 December 26th 07 10:14 PM
can you change the default paste method? (paste values) David A Brown Excel Discussion (Misc queries) 3 December 18th 07 09:59 AM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM
How do i compare values from two sheet and copy & paste if values match? rozb Excel Programming 0 March 5th 04 12:06 AM


All times are GMT +1. The time now is 02:40 PM.

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"