Forum Discussion

Medhi-RC's avatar
Medhi-RC
Copper Contributor
Dec 29, 2022

If there is a certain Text -> CheckBox disappear

Hello,

I would like to ask you if you know a function that could allow this : 

I have a dropdown list, I use a ComboBox, and depending on what element you have selected, texts appear/disappear. I have put conditional formatting for this, using white font, and cell are filled in white

 

But, I would like also, that if you have selected a certain element in the ComboBox, you can't see the check box. For instance, if you have selected in the dropdown list (ComboBox) the element "Fish", you can see a checkbox, but you can't see this check box if you have selected "Dog". And the same way, if you have selected "Fish" or "Dog", you can/can't see this one.

 

Could you help me, please? 

  • XXplore's avatar
    XXplore
    Brass Contributor
    I suppose you're using Develop->Controls->Insert->Combo/CheckBox,
    And I think you need use VBA.

    (1) Create a macro, where "H7" is the cell linked to ComboBox, "2" is the value you want to blank the CheckBox. Modify the names according to yours.
    Sub Macro1()
    If Range("H7") = 2 Then
    Sheets("Sheet2").CheckBoxes("Check Box 4").Visible = False
    Else
    Sheets("Sheet2").CheckBoxes("Check Box 4").Visible = True
    End If
    End Sub

    (2) Right click the ComboBox and assign this macro to it.
  • Medhi-RC 

    What check box do you mean? Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

Resources