How to uncheck another checkbox when a checkbox is checked in Excel?
In many practical scenarios, such as managing a lengthy purchase list in Excel, you may encounter situations where you want to ensure that only one option can be selected within a specific category or group. For instance, if certain categories exceed the set budget, you may need to reselect items so that only one remains checked in each group. Manually managing checkboxes in large lists can be inefficient and error-prone, especially as the number of categories grows. To streamline this process and reduce mistakes, you can set up Excel so that checking a new checkbox within a group will automatically uncheck the previously selected one, ensuring only a single selection per category at any time. This article provides a step-by-step guide on how to achieve this, making your workflow more efficient and reliable.
Uncheck another checkbox when a new checkbox is checked with VBA code
To illustrate the process, consider a situation as shown in the video above. You have ten checkboxes labeled CheckBox1 through CheckBox10, organized into three groups representing different purchase categories.
✅ Group structure:
- Group 1: CheckBox1, CheckBox2, CheckBox3
- Group 2: CheckBox4, CheckBox5, CheckBox6, CheckBox7
- Group 3: CheckBox8, CheckBox9, CheckBox10
Within each group, only one checkbox should be selected at a time. When a new checkbox is checked, the others in the same group are automatically unchecked—similar to radio button behavior but using checkboxes.
🧩 Steps to apply the VBA solution:
- Open the VBA Editor: Right-click the sheet tab where the checkboxes are placed, then choose View Code.
- Paste the following code into the worksheet's code window:
- Close the VBA Editor (Alt + Q) and return to Excel to test the checkboxes.

Dim xBol As Boolean
'Updated by Extendoffice
Private Sub CheckBox1_Change(): SetCheckBoxes "CheckBox1": End Sub
Private Sub CheckBox2_Change(): SetCheckBoxes "CheckBox2": End Sub
Private Sub CheckBox3_Change(): SetCheckBoxes "CheckBox3": End Sub
Private Sub CheckBox4_Change(): SetCheckBoxes "CheckBox4": End Sub
Private Sub CheckBox5_Change(): SetCheckBoxes "CheckBox5": End Sub
Private Sub CheckBox6_Click(): SetCheckBoxes "CheckBox6": End Sub
Private Sub CheckBox7_Click(): SetCheckBoxes "CheckBox7": End Sub
Private Sub CheckBox8_Click(): SetCheckBoxes "CheckBox8": End Sub
Private Sub CheckBox9_Click(): SetCheckBoxes "CheckBox9": End Sub
Private Sub CheckBox10_Click(): SetCheckBoxes "CheckBox10": End Sub
Private Function SetCheckBoxes(mCheckBoxName As String)
Dim xAllArr, xArrItem
Dim xI, xJ
If Not xBol Then Exit Function
xAllArr = Array("CheckBox1,CheckBox2,CheckBox3", _
"CheckBox4,CheckBox5,CheckBox6,CheckBox7", _
"CheckBox8,CheckBox9,CheckBox10")
For xI = LBound(xAllArr) To UBound(xAllArr)
If InStr(xAllArr(xI), mCheckBoxName) > 0 Then
xBol = False
xArrItem = Split(xAllArr(xI), ",")
For xJ = LBound(xArrItem) To UBound(xArrItem)
If xArrItem(xJ) <> mCheckBoxName Then
Me.OLEObjects(xArrItem(xJ)).Object.Value = False
End If
Next
End If
Next
xBol = True
End Function
Private Sub Worksheet_Activate(): xBol = True: End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range): xBol = True: End Sub
📌 Important Notes:
- Ensure your checkbox Name properties (not labels) exactly match the names in the code.
- Groupings are defined in the array line:
xAllArr = Array("CheckBox1,CheckBox2,CheckBox3", "CheckBox4,CheckBox5,CheckBox6,CheckBox7", "CheckBox8,CheckBox9,CheckBox10")
- This VBA only works with ActiveX Control checkboxes, not Form Controls.
- Macros must be enabled for this automation to function.
📺 Demo:
🔍 Troubleshooting Tips:
- Verify no duplicate checkbox names.
- Ensure all checkboxes are ActiveX Controls.
- Each checkbox procedure must correctly call
SetCheckBoxes
. - Cross-sheet scenarios require adaptation via class modules or centralized control.
💡 Alternative Solution: You can use Option Buttons from Form Controls for built-in single selection behavior. However, for advanced layouts and logic control, VBA + Checkboxes is more flexible.
✨ Tip: Tools like Kutools for Excel offer GUI-based checkbox management for easier setup without coding.
Demo: Uncheck another checkbox when a checkbox is checked in Excel
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.





- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in