Written by Allen Wyatt (last updated October 16, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
Joan ran into a problem on a new computer system she got. On an older system she had a macro that would essentially perform "Paste Special—Formula." When she tried to record the same macro on her new system, Excel generated an error message and wouldn't record the macro.
It's unclear why Excel would be generating an error message when trying to record such a simple macro. We were able to record the steps with no problem. It could be that the error is related, somehow, to the conditions existing when trying to do the recording. For instance, the Clipboard may not actually contain a formula that could be pasted, or you could be trying to paste in a protected worksheet.
Be that as it may, it is just as easy to create a Paste Special—Formula macro from scratch. The following is the same as what would have been recorded by the Macro recorder, and it can be entered directly into a macros module in the VBA Editor:
Sub PasteFormulas() Selection.PasteSpecial Paste:=xlPasteFormulas, _ Operation:=xlNone, SkipBlanks:=False, _ Transpose:=False End Sub
Note that the macro has only a single line to do the actual pasting. In order to use it, simply copy some cells to the Clipboard, select where you want the formulas pasted, and then run the macro. You can assign it to a shortcut key to make using it even easier.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10429) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Trouble Recording Paste Special Formula.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Excel allows you to easily paste graphics into a worksheet. Once added, you may want to quickly process the graphics by ...
Discover MoreWhen your macro is humming along, minding its own business, a user watching the screen may not see any activity and ...
Discover MoreYou can easily use formulas to pull apart text stored in a cell. For instance, if you need to pull individual characters ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-10-17 09:57:33
J. Woolley
I guess I missed the point of this Tip. It is about the macro recorder, not that anyone would actually want a PasteFormulas macro. If you really want to PasteFormulas, you can simply right-click the target and pick from Paste Options.
2021-10-16 10:30:36
J. Woolley
Or you can right-click the Quick Access Toolbar and pick Customize Quick Access Toolbar > Commands Not in the Ribbon > Paste Formulas > Add.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments