Copy / Paste Value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was very happy when I found that I could simplify my code when copy and
pasting to one line as follows

Range("Current_Prices").Copy Destination:=Range

However I would like to paste the value. Is this possible in one line or do
we have to make do with

Application.Goto Reference:="Current_Prices"
Selection.Copy
Application.Goto Reference:="Previous_Prices"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Thanks in advance for your assistance
 
I was very happy when I found that I could simplify my code when copy and
pasting to one line as follows

Range("Current_Prices").Copy Destination:=Range

However I would like to paste the value. Is this possible in one line or do
we have to make do with

Application.Goto Reference:="Current_Prices"
Selection.Copy
Application.Goto Reference:="Previous_Prices"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Thanks in advance for your assistance

try with this "Worksheets("NameOfSheet").Range("C3").Copy
Destination:=Worksheets("NameOfSheet").Range("C10")"
 
I think I might not have been very clear.


My problem is that I can easily copy and paste using 1 line of code. What I
am copying is a formula and I would like to simplify the code for copying and
pasting the VALUE, not the formula itself.
 
OK, Iknow have this down to 2 lines

Range("C8").Copy
Range("E10").PasteSpecial xlPasteValues

Is there any way to improve on this?
 
OK, Iknow have this down to 2 lines

Range("C8").Copy
Range("E10").PasteSpecial xlPasteValues

Is there any way to improve on this?

Yes!

Range("C8").Copy: Range("E10").PasteSpecial xlPasteValues
 
Not really an improvement, but another alternative:

with activesheet
.range("E10").value = .range("C8").value
end with
 
Personally, I wouldn't use this. Under most circumstances, I find this harder
to read.
 

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