

EXCEL VBA ON CELL CHANGE VALUE CODE
In the Microsoft Visual Basic for Applications window, please copy and paste the below VBA code into the Code window. Right click the Sheet Tab with the cell value you need to change based on checkbox, then click View Code from the right-clicking menu.Ģ. You can also change a specified cell value when checkbox is checked with VBA code. You can see the results as below screenshots shown after checking or unchecking the corresponding check box. Note: In the formula, C2 is the linked cell of the check box 1, “Test” is the value you need to display in cell A1 when the check box is checked. Select the cell you need to change its value (here I select A1), then enter formula =IF(C2,"Test","") into the Formula Bar, and press the Enter key. And in the Properties dialog box, enter the linked cell into the LinkedCell field, and then close the dialog box. Here I link the checkbox 1 to cell C2 with entering =C2 into the Formula Bar after selecting the checkbox.įor ActiveX Control check box, please right click it and select Properties from the right-clicking menu. To link the checkbox to a certain cell, please select it, then enter= cell reference into the Formula Bar and press the Enter key. You need to link the checkbox to a certain cell firstly, and then apply formula to achieve it.ġ. And blank the cell when unchecking the check box. Supposing you need cell A1 to be populated with value “test” when the check box 1 is checked. Please follow the below methods step by step to deal with it.Ĭhange a specified cell value when checkbox is checked with formulaĬhange a specified cell value when checkbox is checked with VBA codeĬhange a specified cell color when checkbox is checked with VBA code For example, when a certain checkbox is checked, the value or background color of a specified cell will be changed automatically. This article is talking about changing the value or color of a specified cell by a checkbox.

EXCEL VBA ON CELL CHANGE VALUE HOW TO
How to change a specified cell value or color when checkbox is checked in Excel?
