Home > front end >  select checkbox, previous selected check box will uncheck in excel
select checkbox, previous selected check box will uncheck in excel

Time:12-20

I have an excel file that I place a check box as I cannot use the radio button due the check box is linked with formula on excel, in the selection i.e. 1 2 3 4 if I select check box 1, then I select check box 3, check box 1 check should uncheck automatically

Sample Picture

CodePudding user response:

From what I understand from your question is that you want that, in each row when you mark a checkbox, the others are deactivated automatically.

There are two options:

  1. Option 1

This option is the simplest, however, instead of using the checkboxes, the option buttons are used.

1.1 Step 1

Insert a Groupbox, for which you go to: Developer -> Insert -> Group Box (see Figure 1)

Figure 1

1.2 Step 2

Insert an Option Button, for which you go to: Developer -> Insert -> Option Button (see Figure 2)

Figure 2

1.3 Step 3

Once you add the "Option Buttons", you right click on one of them and press "Format Control" then click on "Control" and assign a destination cell. You only need to do this once as the rest of the “Option Buttons” are configured automatically (see Figure 3).

Figure 3

1.4 Note

When doing this, the destination cell varies with numerical values corresponding to the number of the selected button, which seems to better fit what you are trying to do (see Figure 4).

Figure 4

  1. Option 2

In this option, simple macros are used to relate the Checkboxes to each other.

2.1 Step 1

Click on Developer -> Record Macro

2.2 Step 2

Right click on Checkbox 1 and press Format Control. Then go to Control and select Checked for Checkbox 1

2.3 Step 3

For Checkbox 2, 3 and 4 the same procedure is repeated, only the Unchecked option is marked

2.4 Step 4

Stop the macro recording and assign the macro to Checkbox 1. Then you must repeat everything mentioned above with Checkbox 2, 3 and 4

An example of this are for the Checkbox 1 and 3 (see Figure 5 and 6)

Figure 5

Figure 6

The result would be something like this (see Figure 7)

Figure 7

And that's it!, however if you use option 2 remember to save your file as a macro-enabled book

  • Related