Would like a more efficient way to Copy/PasteSpecial

S

StevenM

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

PY & Associates

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
 
R

Rich Locus

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
 
J

Jef Gorbach

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

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

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

Top