Silly Q, but a pattern that I use a lot in my file is copying a formula from a 'source' cell (e.g. A1) to a defined range (e.g. A2:A99), but since I want values A2:A99 to be hardcoded for file speed, I'll then Copy A2:A99 and paste_values A2:A99.
So the code ends up looking something like this:
Is there a faster way to do that? Like some kind of paste function that in a single action tells Excel to paste the RESULT of the formulas rather than the formulas themselves?
So the code ends up looking something like this:
Code:
Range("formula").[B]Copy[/B]
Range(Range("paste_range").Value).[B]PasteSpecial[/B] Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range(Range("paste_range").Value).[B]Copy[/B]
Range(Range("paste_range").Value).[B]PasteSpecial [/B]Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Is there a faster way to do that? Like some kind of paste function that in a single action tells Excel to paste the RESULT of the formulas rather than the formulas themselves?
Last edited: