ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Paste Special (Values) (https://www.excelbanter.com/excel-programming/394915-paste-special-values.html)

Chris

Paste Special (Values)
 
I have the following code and I want to paste it as values.

Sheets("TableData").Range("A" & k).Copy
Destination:=Sheets("Sheet2").Range("A" & j)

(k and j are variables.)


Anony

Paste Special (Values)
 
Sheets("TableData").Range("A" & k).Copy
Sheets("Sheet2").Activate
Sheets("Sheet2").Range("A1").PasteSpecial Paste:=xlPasteValues

What you want to specify as your destination is the top left-most cell of
your destination range.

------
Cheers,
Anony


"Chris" wrote:

I have the following code and I want to paste it as values.

Sheets("TableData").Range("A" & k).Copy
Destination:=Sheets("Sheet2").Range("A" & j)

(k and j are variables.)



Dave Peterson

Paste Special (Values)
 
Sheets("TableData").Range("A" & k).Copy
Sheets("Sheet2").Range("A" & j).pastespecial paste:=xlpastevalues

or just assign the value

Sheets("Sheet2").Range("A" & j).value _
= Sheets("TableData").Range("A" & k).value


Chris wrote:

I have the following code and I want to paste it as values.

Sheets("TableData").Range("A" & k).Copy
Destination:=Sheets("Sheet2").Range("A" & j)

(k and j are variables.)


--

Dave Peterson

Trevor Shuttleworth

Paste Special (Values)
 
Something like:

With Sheets("TableData")
.Range("A" & k).Copy
.Range("A" & j).PasteSpecial _
Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
End With

Regards

Trevor


"Chris" wrote in message
ups.com...
I have the following code and I want to paste it as values.

Sheets("TableData").Range("A" & k).Copy
Destination:=Sheets("Sheet2").Range("A" & j)

(k and j are variables.)




Trevor Shuttleworth

Paste Special (Values)
 
Sorry

missed the fact that the destination was on another sheet. But the others
have given the answer

Regards


"Trevor Shuttleworth" wrote in message
...
Something like:

With Sheets("TableData")
.Range("A" & k).Copy
.Range("A" & j).PasteSpecial _
Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
End With

Regards

Trevor


"Chris" wrote in message
ups.com...
I have the following code and I want to paste it as values.

Sheets("TableData").Range("A" & k).Copy
Destination:=Sheets("Sheet2").Range("A" & j)

(k and j are variables.)






Chris

Paste Special (Values)
 
On Aug 6, 5:05 pm, Dave Peterson wrote:
Sheets("TableData").Range("A" & k).Copy
Sheets("Sheet2").Range("A" & j).pastespecial paste:=xlpastevalues

or just assign the value

Sheets("Sheet2").Range("A" & j).value _
= Sheets("TableData").Range("A" & k).value

Chris wrote:

I have the following code and I want to paste it as values.


Sheets("TableData").Range("A" & k).Copy
Destination:=Sheets("Sheet2").Range("A" & j)


(k and j are variables.)


--

Dave Peterson


Thanks! Your second method gets the job done.



All times are GMT +1. The time now is 09:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com