Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Trouble Recording Paste Special Formula.

Trouble Recording Paste Special Formula

Written by Allen Wyatt (last updated October 16, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


2

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:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10429) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Trouble Recording Paste Special Formula.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Sorting a Text Selection

Word gives you the option to sort selected groups of text. You can do text, date or number sorts on whole paragraphs or ...

Discover More

Setting Spell-Checking Options

The spell checker can come in handy when entering data in a worksheet. Because the type of data you enter can vary so ...

Discover More

Changing Default Search Settings

Excel provides some great tools for finding information in a worksheet or a workbook. Changing the default settings used ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Running Macros in the Background

Want to run a macro in Excel, but not sure if doing so will tie up your computer? Here's how macro processing really happens.

Discover More

Counting Empty Colored Cells

There are a variety of ways that you might want to count the cells in your worksheet. One way is to figure out how many ...

Discover More

Replacing Commas with Periods

Want to replace all commas in a formatted number with periods, and vice-versa? There are a couple of approaches you can ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 5?

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.


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.