Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Copy / Paste Value

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Copy / Paste Value

On 6 ruj, 13:00, Richard wrote:
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" )"


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Copy / Paste Value

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.

"I.R;))" wrote:

On 6 ruj, 13:00, Richard wrote:
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" )"



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Copy / Paste Value

OK, Iknow have this down to 2 lines

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

Is there any way to improve on this?

"I.R;))" wrote:

On 6 ruj, 13:00, Richard wrote:
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" )"



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Copy / Paste Value

On 7 ruj, 11:50, Richard wrote:
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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy / Paste Value

Not really an improvement, but another alternative:

with activesheet
.range("E10").value = .range("C8").value
end with



Richard wrote:

OK, Iknow have this down to 2 lines

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

Is there any way to improve on this?

"I.R;))" wrote:

On 6 ruj, 13:00, Richard wrote:
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" )"




--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy / Paste Value

Personally, I wouldn't use this. Under most circumstances, I find this harder
to read.

"I.R;))" wrote:

On 7 ruj, 11:50, Richard wrote:
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


--

Dave Peterson
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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy, paste without file name referenced after paste AusTexRich Excel Discussion (Misc queries) 6 September 23rd 08 02:57 AM
help w/ generic copy & paste/paste special routine DavidH[_2_] Excel Programming 5 January 23rd 06 03:58 AM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 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"