ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Would like a more efficient way to Copy/PasteSpecial (https://www.excelbanter.com/excel-programming/440535-would-like-more-efficient-way-copy-pastespecial.html)

StevenM

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")


PY & Associates[_2_]

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


Rich Locus

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")


StevenM

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")


Jef Gorbach[_2_]

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



All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com