PC Review


Reply
Thread Tools Rate Thread

Copy from here to there

 
 
Francis Hookham
Guest
Posts: n/a
 
      12th Jan 2007
Mind's gone blank!

Range("B4:B45").Select
Selection.Copy
Range("F4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Not done recently and cannot remeber how to do it directly something like
this
Range(Cells(4, 6), Cells(45, 6)) = Range(Cells(4, 2), Cells(45, 2))
which of course does not work
and, anyway, I want Values only copied across

Help please

Francis Hookham



 
Reply With Quote
 
 
 
 
Francis Hookham
Guest
Posts: n/a
 
      12th Jan 2007
Many thanks Garry's Student

Any reason why I should not simplify it to:

Range(Cells(4, 2), Cells(45, 2)).Copy
Range(Cells(4, 6), Cells(45, 6)).PasteSpecial xlPasteValues

which works.

I had hoped for something whch did not go and copy and then paste - surely I
have seen/used in the past something like 'CopyDestination', as in
Range(Cells(4, 2), Cells(45, 2)).CopyDestination = Range(Cells(4, 6),
Cells(45, 6))

(bear in mind that Range(Cells(4, 2), Cells(45, 2)) contains '=Present!R'
collecting data from another worksheet which is why PasteSpecial
xlPasteValues is needed.

Am I expecting too much?

Francis Hookham


"Gary''s Student" <(E-Mail Removed)> wrote in message
news:C9650FC7-21AB-44FF-905C-(E-Mail Removed)...
> You were almost there:
>
> Sub francis()
> Dim r1 As Range, r2 As Range
> Set r1 = Range(Cells(4, 6), Cells(45, 6))
> Set r2 = Range(Cells(4, 2), Cells(45, 2))
> r2.Copy
> r1.PasteSpecial xlPasteValues
> End Sub
>
>
> --
> Gary''s Student
>
>
> "Francis Hookham" wrote:
>
>> Mind's gone blank!
>>
>> Range("B4:B45").Select
>> Selection.Copy
>> Range("F4").Select
>> Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
>> SkipBlanks _
>> :=False, Transpose:=False
>>
>> Not done recently and cannot remeber how to do it directly something like
>> this
>> Range(Cells(4, 6), Cells(45, 6)) = Range(Cells(4, 2), Cells(45, 2))
>> which of course does not work
>> and, anyway, I want Values only copied across
>>
>> Help please
>>
>> Francis Hookham
>>
>>
>>
>>



 
Reply With Quote
 
Francis Hookham
Guest
Posts: n/a
 
      12th Jan 2007
Actually
Range(Cells(4, 2), Cells(48, 2)).Copy
Cells(4, 6).PasteSpecial xlPasteValues
is more economical

FH


"Gary''s Student" <(E-Mail Removed)> wrote in message
news:C9650FC7-21AB-44FF-905C-(E-Mail Removed)...
> You were almost there:
>
> Sub francis()
> Dim r1 As Range, r2 As Range
> Set r1 = Range(Cells(4, 6), Cells(45, 6))
> Set r2 = Range(Cells(4, 2), Cells(45, 2))
> r2.Copy
> r1.PasteSpecial xlPasteValues
> End Sub
>
>
> --
> Gary''s Student
>
>
> "Francis Hookham" wrote:
>
>> Mind's gone blank!
>>
>> Range("B4:B45").Select
>> Selection.Copy
>> Range("F4").Select
>> Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
>> SkipBlanks _
>> :=False, Transpose:=False
>>
>> Not done recently and cannot remeber how to do it directly something like
>> this
>> Range(Cells(4, 6), Cells(45, 6)) = Range(Cells(4, 2), Cells(45, 2))
>> which of course does not work
>> and, anyway, I want Values only copied across
>>
>> Help please
>>
>> Francis Hookham
>>
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
http://LongPathTool.com - find and delete/copy path too long filesfrom your hard drive or LAN Windows tool to copy or delete files and folderswith path too long or filename too long error. Just browse to the file andpress a button to copy or d Martin Krag Windows XP Internet Explorer 0 22nd Apr 2011 10:08 AM
http://LongPathTool.com - find and delete/copy path too long filesfrom your hard drive or LAN Windows tool to copy or delete files and folderswith path too long or filename too long error. Just browse to the file andpress a button to copy or d Martin Krag Windows XP Configuration 0 22nd Apr 2011 10:05 AM
Copy local users and groups, copy shares with security, copy homeuser folders usenet@sphere10.com Microsoft Windows 2000 Active Directory 1 17th Feb 2009 01:31 PM
Copy local users and groups, copy shares with security, copy homeuser folders usenet@sphere10.com Windows Vista General Discussion 2 17th Feb 2009 01:31 PM
EXCEL FILE a copy/a copy/a copy ....filename =?Utf-8?B?dmU=?= Microsoft Excel New Users 1 29th Sep 2005 09:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:20 AM.