Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Would like a more efficient way to Copy/PasteSpecial

I was doing this:

Range("H1:H5").Select
Selection.Copy
Range("B1:B5").Select
ActiveSheet.Paste
Application.CutCopyMode = False

and then came across this technique which apparently
is more efficient:

Range("H1:H5").Copy Range("B1:B5")



Can you do the same thing when trying to PasteSpecial Values?
Is there a more efficient way to do this:
Range("H1:H5").Select
Selection.Copy
Range("B1:B5").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


Can you do something like?
Range("H1:H5").PasteSpecialPaste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False Range("B1:B5")

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Would like a more efficient way to Copy/PasteSpecial

On Mar 12, 9:11*am, StevenM wrote:
I was doing this:

* * Range("H1:H5").Select
* * Selection.Copy
* * Range("B1:B5").Select
* * ActiveSheet.Paste
* * Application.CutCopyMode = False

and then came across this technique which apparently
is more efficient:

* * Range("H1:H5").Copy Range("B1:B5")

Can you do the same thing when trying to PasteSpecial Values?
Is there a more efficient way to do this:
* * Range("H1:H5").Select
* * Selection.Copy
* * Range("B1:B5").Select
* * Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
* * * * SkipBlanks:=False, Transpose:=False
* * Application.CutCopyMode = False

Can you do something like?
* * Range("H1:H5").PasteSpecialPaste:=xlPasteFormats, Operation:=xlNone, _
* * * * SkipBlanks:=False, Transpose:=False * Range("B1:B5")


Not tested, but I think it should be two lines like this

Range("H1:H5").copy
Range("B1:B5").PasteSpecial

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Would like a more efficient way to Copy/PasteSpecial

Hello:

PY And Associates had a good answer. You can even use the Cells format by
pointing to the first cell of the target range for the paste:

Public Sub Tester()
Range("H1:H5").Copy

Range("A1:A5").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False


**** Or ******
Cells(2, 1).PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

End Sub

--
Rich Locus
Logicwurks, LLC


"StevenM" wrote:

I was doing this:

Range("H1:H5").Select
Selection.Copy
Range("B1:B5").Select
ActiveSheet.Paste
Application.CutCopyMode = False

and then came across this technique which apparently
is more efficient:

Range("H1:H5").Copy Range("B1:B5")



Can you do the same thing when trying to PasteSpecial Values?
Is there a more efficient way to do this:
Range("H1:H5").Select
Selection.Copy
Range("B1:B5").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


Can you do something like?
Range("H1:H5").PasteSpecialPaste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False Range("B1:B5")

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Would like a more efficient way to Copy/PasteSpecial

Thanks to both. I appreciate your taking time to help educate me.
s.

"Rich Locus" wrote:

Hello:

PY And Associates had a good answer. You can even use the Cells format by
pointing to the first cell of the target range for the paste:

Public Sub Tester()
Range("H1:H5").Copy

Range("A1:A5").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False


**** Or ******
Cells(2, 1).PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

End Sub

--
Rich Locus
Logicwurks, LLC


"StevenM" wrote:

I was doing this:

Range("H1:H5").Select
Selection.Copy
Range("B1:B5").Select
ActiveSheet.Paste
Application.CutCopyMode = False

and then came across this technique which apparently
is more efficient:

Range("H1:H5").Copy Range("B1:B5")



Can you do the same thing when trying to PasteSpecial Values?
Is there a more efficient way to do this:
Range("H1:H5").Select
Selection.Copy
Range("B1:B5").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


Can you do something like?
Range("H1:H5").PasteSpecialPaste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False Range("B1:B5")

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Would like a more efficient way to Copy/PasteSpecial

Couldn't you also specify the destination on the copy line, like so:

Range("H1:H5").copy Destination:=Range("B1:B5").PasteSpecial

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
Efficient Way of Copy/PasteSpecial of Non-Continuous Range in VBA monir Excel Programming 3 December 18th 08 09:55 PM
efficient code to copy/paste Ivano Excel Programming 7 May 14th 08 05:21 PM
Copy & Paste code more efficient Desert Piranha[_102_] Excel Programming 12 August 16th 06 04:51 AM
More efficient copy/paste?? Celt[_64_] Excel Programming 6 June 9th 06 07:21 PM
Efficient Copy/Paste William Benson[_2_] Excel Programming 4 September 8th 05 07:42 PM


All times are GMT +1. The time now is 07:01 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"