Refered to this site from another forum.
I'm trying to combine copy and pastespecial format to one line.
I was pointed to these example codes. I love the idea of copy and paste without using the clipboard but I cannot convert to Pastespecial- Format only.
Code
Sub NoCopyAndPaste()
'Instead of:
Sheet1.Range("A1:A200").Copy
Sheet2.Range("B1").pasteSpecial
Application.CutCopyMode=False'Clear Clipboard
'Use:
'By-passes the Clipboard
Sheet1.Range("A1:A200").Copy Destination:=Sheet2.Range("B1")
'Or, if only values are needed:
Sheet2.Range("B1:B200").Value= Sheet1.Range("A1:A200").Value
'Or, if only formulae are needed:
Sheet2.Range("B1:B200").Formula = Sheet1.Range("A1:A200").Formula
'See also FormulaArray and FormulaR1C1 etc
'Instead of:
Sheet1.Range("A1:A200").Copy
Sheet1.Range("A1:A200").PasteSpecial xlPasteValues
Application.CutCopyMode=False'Clear Clipboard
'Use:
Sheet1.Range("A1:A200") = Sheet1.Range("A1:A200").Value
End Sub
Display More