Skip to main content

How to allow only one checkbox in a group to be selected in Excel?

Author: Siluvia Last Modified: 2025-07-24

In some Excel applications, you might need to let users select only one option from a group of checkboxes—mimicking the behavior of radio buttons. For example, as shown in the screenshot below, when you check one checkbox in row2, all other checkboxes in the group are instantly disabled, ensuring that only a single choice is possible at any one time. This restriction is useful in survey forms, single-answer selection lists, or dashboards where you want to prevent multiple answers. Achieving this functionality directly in Excel requires specific techniques, such as using VBA code. This article provides practical solutions to enable a "single selection" effect with checkboxes in Excel, including step-by-step instructions and important considerations for real-world usage.

A screenshot of a group of checkboxes in Excel where only one can be selected at a time


Only make one checkbox to be selected with VBA code

You can use the following VBA approach to ensure only one checkbox in a group may be selected at a time. This solution is especially suitable when you need a seamless, automatic experience—ideal for complex templates or when controlling enable/disable logic is important.

1. Start by inserting the checkboxes where you want a single selection enforced. For this solution, you must use ActiveX Control checkboxes, as Form Controls checkboxes do not support the enable/disable mechanism directly. To insert ActiveX checkboxes, go to Developer tab > Insert > ActiveX Controls > Check Box. Arrange all checkboxes within your desired group as shown below:

A screenshot showing the insertion of ActiveX Control checkboxes in Excel

2. Press Alt + F11 together to open the Microsoft Visual Basic for Applications window. 

3. In the editor window, click Insert > Class Module. This step creates a new class module, which is required for handling events for multiple checkboxes. Using a class module makes it possible to respond to each checkbox being clicked individually, no matter how many checkboxes are present.

A screenshot showing the option to insert a Class Module in Excel VBA

4. Find the new class module in the Properties pane (usually on the left), click it, and in the (Name) box, rename it from the default value (such as Class1) to ClsChk. Then, copy and paste the following code into the code window of this class module. See screenshot as reference:

A screenshot of the Properties pane in VBA for renaming the class to ClsChk

VBA code1: Only select one checkbox per time

Option Explicit
Public WithEvents Chk As MSForms.CheckBox
Private Sub Chk_Click()
Call SelOneCheckBox(Chk)
End Sub

Sub SelOneCheckBox(Target As Object)
Dim xObj As Object
Dim I As String
Dim n As Integer
If Target.Object.Value = True Then

    I = Right(Target.Name, Len(Target.Name) - 8)
    For n = 1 To ActiveSheet.OLEObjects.Count
      If n <> Int(I) Then
        Set xObj = ActiveSheet.OLEObjects.Item(n)
        xObj.Object.Value = False
        xObj.Object.Enabled = False
      End If
    Next
Else
    I = Right(Target.Name, Len(Target.Name) - 8)
    For n = 1 To ActiveSheet.OLEObjects.Count
      If n <> Int(I) Then
        Set xObj = ActiveSheet.OLEObjects.Item(n)
        xObj.Object.Enabled = True
      End If
    Next
End If
End Sub  

5. Next, click Insert > Module to add a standard code module. Copy and paste the following code into the module window. This code will initialize and "link" all your checkboxes to the event handler defined above:

VBA code2: Only select one checkbox per time

Dim xCollection As New Collection
Public Sub ClsChk_Init()
Dim xSht As Worksheet
Dim xObj As Object
Dim xChk As ClsChk
   Set xSht = ActiveSheet
   Set xCollection = Nothing
    For Each xObj In xSht.OLEObjects
        If xObj.Name Like "CheckBox**" Then
            Set xChk = New ClsChk
            Set xChk.Chk = CallByName(xSht, xObj.Name, VbGet)
            xCollection.Add xChk
        End If
    Next
    Set xChk = Nothing
End Sub

6. Press F5 to execute the code, which activates the single-selection logic for your checkbox group. Test the behavior by checking any of the boxes; all other boxes should immediately become unchecked and disabled. Unchecking your current selection will re-enable all checkboxes so you may make a different selection.

A screenshot of checkboxes in Excel where only one is enabled at a time after VBA code execution

Note: If you add or delete any checkboxes from your group, you will need to rerun the initialization VBA. This is because the event handlers are refreshed each time the code is executed, ensuring any changes to the control group are properly recognized by your VBA.

Advantages of this method include its full automation—users cannot accidentally select multiple options. However, it only works with ActiveX controls, which may be limited by Excel version, and macros need to be enabled. Also, distributing workbooks with ActiveX controls or macros to other users might require additional security permissions.


Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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!