Neutralizer
Board Regular
- Joined
- Sep 23, 2009
- Messages
- 53
Hi All,
I'm looking for a way to bypass the complete copy and paste that you see if you use the macro recorder.
This is a useful reference:
http://www.ozgrid.com/VBA/SpeedingUpVBACode.htm
http://www.ozgrid.com/forum/showthread.php?t=27407&page=1
How do I paste only formats using this method, is it possible?
If not, what is the most efficent way to do this in VBA?
EDIT: Worth noting that this operation is for a very large number of cells, i.e. copying the formats from a range of 1 x 39 cells and applying it to a range of 14,000 x 39 cells.
Cheers
I'm looking for a way to bypass the complete copy and paste that you see if you use the macro recorder.
This is a useful reference:
http://www.ozgrid.com/VBA/SpeedingUpVBACode.htm
However, I have the same problem as the guy in this post:Avoid the use of Copy and Paste whenever Possible:
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
http://www.ozgrid.com/forum/showthread.php?t=27407&page=1
How do I paste only formats using this method, is it possible?
If not, what is the most efficent way to do this in VBA?
EDIT: Worth noting that this operation is for a very large number of cells, i.e. copying the formats from a range of 1 x 39 cells and applying it to a range of 14,000 x 39 cells.
Cheers
Last edited: