Got the Copy/Cut Code But what is the Paste Code

  • Thread starter Thread starter Corey
  • Start date Start date
C

Corey

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....
 
(square brackets are slow)

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

Regards
Jason
 
Thanks Jason for the reply.

What about COPY from sheet1 and paste to sheet2?

Corey....
 
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


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....
 
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 said:
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


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....
 
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 said:
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 said:
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


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....
 
Thank You kindly.

Done the job precisely

Corey....



Dana DeLouis said:
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 said:
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 said:
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


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....
 

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

Back
Top