ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Got the Copy/Cut Code But what is the Paste Code (https://www.excelbanter.com/excel-programming/366544-got-copy-cut-code-but-what-paste-code.html)

Corey

Got the Copy/Cut Code But what is the Paste Code
 
If this code will copy a Cell value:

[R59].Select
ActiveCell.Copy

and this is a Cut code :

[R59].Select
ActiveCell.Cut

What is a Paste Code ?
This don't work :

[R59].Select
ActiveCell.Paste



What is the code equivalent to paste ?

Corey....

WhytheQ

Got the Copy/Cut Code But what is the Paste Code
 
(square brackets are slow)

I quite like this format to copy from A1 to A2:
Range("A1").Copy Range("A2")

Regards
Jason



Corey wrote:
If this code will copy a Cell value:

[R59].Select
ActiveCell.Copy

and this is a Cut code :

[R59].Select
ActiveCell.Cut

What is a Paste Code ?
This don't work :

[R59].Select
ActiveCell.Paste



What is the code equivalent to paste ?

Corey....
------=_NextPart_000_01B2_01C6A203.D81BA5D0
Content-Type: text/html; charset=windows-1250
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 1819

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<HTML<HEAD
<META http-equiv=Content-Type content="text/html; charset=windows-1250"
<META content="MSHTML 6.00.2900.2912" name=GENERATOR
<STYLE</STYLE
</HEAD
<BODY bgColor=#ffffff
<DIV<EM<FONT face="Comic Sans MS"If this code will copy a Cell
value:</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"</FONT</EM&nbsp;</DIV
<DIV<EM<FONT
face="Comic Sans MS"[R59].Select<BR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;
ActiveCell.Copy</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"</FONT</EM&nbsp;</DIV
<DIV<EM<FONT face="Comic Sans MS"and this is a Cut code :</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"</FONT</EM&nbsp;</DIV
<DIV<EM<FONT face="Comic Sans MS"[R59].Select</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"ActiveCell.Cut</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"</FONT</EM<EM<FONT
face="Comic Sans MS"</FONT</EM&nbsp;</DIV
<DIV<EM<FONT face="Comic Sans MS"What is a Paste Code ?</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"This don't work :</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"</FONT</EM&nbsp;</DIV
<DIV<EM<FONT face="Comic Sans MS"[R59].Select</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"ActiveCell.Paste</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"</FONT</EM&nbsp;</DIV
<DIV<EM<FONT face="Comic Sans MS"</FONT</EM&nbsp;</DIV
<DIV<EM<FONT face="Comic Sans MS"</FONT</EM&nbsp;</DIV
<DIV<EM<FONT face="Comic Sans MS"What is the code equivalent to paste
?</FONT</EM</DIV
<DIV<EM<FONT face="Comic Sans MS"</FONT</EM&nbsp;</DIV
<DIV<EM<FONT face="Comic Sans MS"Corey....</FONT</EM</DIV</BODY</HTML

------=_NextPart_000_01B2_01C6A203.D81BA5D0--



Corey

Got the Copy/Cut Code But what is the Paste Code
 
Thanks Jason for the reply.

What about COPY from sheet1 and paste to sheet2?

Corey....



Dana DeLouis

Got the Copy/Cut Code But what is the Paste Code
 
This don't work :
[R59].Select
ActiveCell.Paste
What is a Paste Code ?


Hi. Paste works a little differently. Excel uses a worksheet object, and
not a range object.
As a technique, select the word "Paste" in vba, and hit the F1 button. Then
look under "WorkSheet" object.

Sub Demo()
[R59].Cut

[R59].Select
ActiveSheet.Paste
End Sub

or...

Sub Demo2()
[R59].Cut
ActiveSheet.Paste ([R59])
End Sub

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Corey" wrote in message
...
If this code will copy a Cell value:

[R59].Select
ActiveCell.Copy

and this is a Cut code :

[R59].Select
ActiveCell.Cut

What is a Paste Code ?
This don't work

[R59].Select
ActiveCell.Paste



What is the code equivalent to paste ?

Corey....



Corey

Got the Copy/Cut Code But what is the Paste Code
 
Thanks Dana,

Not sure of the reason, but i think it could be because it is a formula, but
i am getting a "0" value.
I want to copy a (MAX) formula VALUE from sheet1 and place the value
ONLY(Not the formula) to a cell in another sheet.

If i click on the Cell where the value is pasted("0"), the FORMULA BAR
displays the Formula from the Copied Cell in the other sheet, NOT the Actual
Value.

Any way around this that you know of ?
Corey....


"Dana DeLouis" wrote in message
...
This don't work :
[R59].Select
ActiveCell.Paste
What is a Paste Code ?


Hi. Paste works a little differently. Excel uses a worksheet object, and
not a range object.
As a technique, select the word "Paste" in vba, and hit the F1 button.
Then look under "WorkSheet" object.

Sub Demo()
[R59].Cut

[R59].Select
ActiveSheet.Paste
End Sub

or...

Sub Demo2()
[R59].Cut
ActiveSheet.Paste ([R59])
End Sub

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Corey" wrote in message
...
If this code will copy a Cell value:

[R59].Select
ActiveCell.Copy

and this is a Cut code :

[R59].Select
ActiveCell.Cut

What is a Paste Code ?
This don't work

[R59].Select
ActiveCell.Paste



What is the code equivalent to paste ?

Corey....




Tom Ogilvy

Got the Copy/Cut Code But what is the Paste Code
 
Worksheets("sheet1").Range("A1").Copy _
worksheets("sheet2").Range("A2")

--
Regards,
Tom Ogilvy


"Corey" wrote:

Thanks Jason for the reply.

What about COPY from sheet1 and paste to sheet2?

Corey....




Dana DeLouis

Got the Copy/Cut Code But what is the Paste Code
 
I want to copy a (MAX) formula VALUE from sheet1 and place the value
ONLY(Not the formula) to a cell in another sheet.


Hi. You are looking for "PasteSpecial".

Worksheets("Sheet1").Range("R59").Copy
Worksheets("Sheet2").Range("A1").PasteSpecial Paste:=xlPasteValues

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Corey" wrote in message
...
Thanks Dana,

Not sure of the reason, but i think it could be because it is a formula,
but i am getting a "0" value.
I want to copy a (MAX) formula VALUE from sheet1 and place the value
ONLY(Not the formula) to a cell in another sheet.

If i click on the Cell where the value is pasted("0"), the FORMULA BAR
displays the Formula from the Copied Cell in the other sheet, NOT the
Actual Value.

Any way around this that you know of ?
Corey....


"Dana DeLouis" wrote in message
...
This don't work :
[R59].Select
ActiveCell.Paste
What is a Paste Code ?


Hi. Paste works a little differently. Excel uses a worksheet object,
and not a range object.
As a technique, select the word "Paste" in vba, and hit the F1 button.
Then look under "WorkSheet" object.

Sub Demo()
[R59].Cut

[R59].Select
ActiveSheet.Paste
End Sub

or...

Sub Demo2()
[R59].Cut
ActiveSheet.Paste ([R59])
End Sub

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Corey" wrote in message
...
If this code will copy a Cell value:

[R59].Select
ActiveCell.Copy

and this is a Cut code :

[R59].Select
ActiveCell.Cut

What is a Paste Code ?
This don't work

[R59].Select
ActiveCell.Paste



What is the code equivalent to paste ?

Corey....






Corey

Got the Copy/Cut Code But what is the Paste Code
 
Thank You kindly.

Done the job precisely

Corey....



"Dana DeLouis" wrote in message
...
I want to copy a (MAX) formula VALUE from sheet1 and place the value
ONLY(Not the formula) to a cell in another sheet.


Hi. You are looking for "PasteSpecial".

Worksheets("Sheet1").Range("R59").Copy
Worksheets("Sheet2").Range("A1").PasteSpecial Paste:=xlPasteValues

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Corey" wrote in message
...
Thanks Dana,

Not sure of the reason, but i think it could be because it is a formula,
but i am getting a "0" value.
I want to copy a (MAX) formula VALUE from sheet1 and place the value
ONLY(Not the formula) to a cell in another sheet.

If i click on the Cell where the value is pasted("0"), the FORMULA BAR
displays the Formula from the Copied Cell in the other sheet, NOT the
Actual Value.

Any way around this that you know of ?
Corey....


"Dana DeLouis" wrote in message
...
This don't work :
[R59].Select
ActiveCell.Paste
What is a Paste Code ?

Hi. Paste works a little differently. Excel uses a worksheet object,
and not a range object.
As a technique, select the word "Paste" in vba, and hit the F1 button.
Then look under "WorkSheet" object.

Sub Demo()
[R59].Cut

[R59].Select
ActiveSheet.Paste
End Sub

or...

Sub Demo2()
[R59].Cut
ActiveSheet.Paste ([R59])
End Sub

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Corey" wrote in message
...
If this code will copy a Cell value:

[R59].Select
ActiveCell.Copy

and this is a Cut code :

[R59].Select
ActiveCell.Cut

What is a Paste Code ?
This don't work

[R59].Select
ActiveCell.Paste



What is the code equivalent to paste ?

Corey....









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

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