Protecting Formulas in Control-Linked Cells

Written by Allen Wyatt (last updated July 26, 2021)
This tip applies to Excel 2007, 2010, 2013, and 2016


Michael has a form control (a check box) linked to cell A1. He can place a formula into cell A1 that resolves to True or False, and the check box reflects that result. However, if someone clicks on the check box to change it, the formula in cell A1 is overwritten by an explicit True or False. Michael needs the formula in cell A1 to control the check box, but he also needs the user to be able to toggle the check box without overwriting the formula. He wonders if this is possible.

In short, this is not possible. Microsoft intended check boxes to control the value in a cell, and then you could reference that cell in other formulas. They never intended for the linked cells to contain formulas.

One thing you could try, if you desire, is to create a macro that monitors a cell and, if it changes, update a different cell. For instance, you could tie your check box to a different cell (such as cell B1), so that the formula in cell A1 isn't affected when the check box is used. You an then create an event handler macro that examines whatever is in cell A1, and if it changes, then the macro modifies what is in cell B1. This modification in cell B1 will then trigger the change in the check box.

Another macro-based approach is to use a macro to write a formula into cell A1. This is a simple example of such a macro:

Sub CheckBoxState()
    Range("A1").Formula = "=IF(" & Range("A1") & _
      ",""CHECKED"",""NOT CHECKED"")"
End Sub

If you assign this macro to the check box control, then when a person clicks the check box, two things happen. First, the state of the check box is written to cell A1, overwriting whatever is there. Second, the macro is executed, writing the formula back into cell A1. Note that the formula (as defined in this macro) takes into account the value that was just stored in cell A1. Thus, if the check box control writes True into cell A1, then the macro stuffs the following into the cell:


Click the check box again, the value stuffed into the cell changes to False, and the formula that is placed into the cell changes. Of course, you would need to modify the macro so that the formula it forces into cell A1 reflects the formula you really want there.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (113) applies to Microsoft Excel 2007, 2010, 2013, and 2016.

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. ...


Track Changes Thinks the Editor Has Changed

Track changes is a great feature to use when you want to show what has changed in a document. Word should note which ...

Discover More

Files Opening Slowly If Many Files Exist

Managing large numbers of documents in Word can lead to some interesting challenges. One potential challenge is that your ...

Discover More

Splitting Sentences to Cells

If you have a lot of text in your workbook, at some point you might want to split out sentences into individual cells. ...

Discover More

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!

More ExcelTips (ribbon)

Independent Radio Buttons

Radio buttons are great for some data collection purposes. They may not be that great for some purposes, however, for the ...

Discover More

Using Data Forms

Lots of people prefer to enter information directly into Excel, but there is another way that may be helpful: Using data ...

Discover More

Using List Box Controls

List boxes can be a great tool for getting input from users of your worksheets. This tip describes what list boxes are ...

Discover More

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

View most recent newsletter.


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 seven more than 9?

2017-03-28 07:42:59


This almost worked. 1st check updated cell A1 but the second Uncheck caused a macro error.

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

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.