I want to hide rows when the Axtivex checkbox isn't checked.
So on a sheet nbr of AxtiveX checkboxes some basic text in fields, and some Activex Combo boxes
So I'm running a very simple script
This works fine in hiding the Combo and checkboxes.
But when I activate --> Rows(5).EntireRow.Hidden = Not CheckBox1.Value (or similar line) then the row dissapears as wanted.
But if then change the state of the combobox (in the above Checkbox) to make it (dis)appear the I can no longer select the Checkbox2
Seems like making that row appear / disappear / appear changes the character of the combox.
So basically all works, but only 1 time.
My issue is, a user changes his mind. Is there a line of code that should be added somewhere.
Thanks
So on a sheet nbr of AxtiveX checkboxes some basic text in fields, and some Activex Combo boxes
So I'm running a very simple script
VBA Code:
Private Sub CheckBox1_Change()
' Show or hide CheckBox2 based on the value of CheckBox1
CheckBox2.Visible = CheckBox1.Value
' Show or hide row 5 based on the value of CheckBox1
Rows(5).EntireRow.Hidden = Not CheckBox1.Value
'ComboBox2.Visible = CheckBox1.Value
End Sub
Private Sub CheckBox2_Change()
' Show or hide CheckBox3 based on the value of CheckBox1
CheckBox3.Visible = CheckBox2.Value
' Show or hide row 5 based on the value of CheckBox1
' Rows(8).EntireRow.Hidden = Not CheckBox2.Value
ComboBox3.Visible = CheckBox2.Value
End Sub
Private Sub CheckBox3_Change()
' Show or hide CheckBox4 based on the value of CheckBox1
CheckBox4.Visible = CheckBox3.Value
' Show or hide row 5 based on the value of CheckBox1
' Rows(8).EntireRow.Hidden = Not CheckBox2.Value
ComboBox4.Visible = CheckBox3.Value
End Sub
This works fine in hiding the Combo and checkboxes.
But when I activate --> Rows(5).EntireRow.Hidden = Not CheckBox1.Value (or similar line) then the row dissapears as wanted.
But if then change the state of the combobox (in the above Checkbox) to make it (dis)appear the I can no longer select the Checkbox2
Seems like making that row appear / disappear / appear changes the character of the combox.
So basically all works, but only 1 time.
My issue is, a user changes his mind. Is there a line of code that should be added somewhere.
Thanks
ActiceX Combo Box.xlsb | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | |||||
2 | Deze lijn is zichtbaar | ||||
3 | |||||
4 | |||||
5 | Deze lijn is enkel zichtbaar indien Checkbox 1 geselecteerd is | ||||
6 | |||||
7 | |||||
8 | Deze lijn is enkel zichtbaar indien Checkbox 2 geselecteerd is | ||||
9 | |||||
10 | |||||
11 | Deze lijn is enkel zichtbaar indien Checkbox 3 geselecteerd is | ||||
12 | |||||
13 | |||||
14 | Aanpassing Active x via Developer / design mode / properties | ||||
15 | View code voor scripts | ||||
16 | |||||
Boxes as you need |