Dear reader,

Since recently i am working on a excel sheet in which i want to hide and unhide specific rows based on the input of a form.

At the moment i have created a button and i attached a form to it in VBA. The form has multiple inputs (around 9). The user can either select one option or more. Each option is linked to a row which will either be hidden (if the option is unselected) or visible (if the option is selected).

The code i have created is the following:

Private Sub OK_Click()

'Make Sheet1 Active
 Sheets(1).Activate
 
'uitbreidingen
    If contactmelder.Value = False Then Rows("17:17").Hidden = True Else Rows("17:17").Hidden = False
    If gasdetector.Value = False Then Rows("18:18").Hidden = True Else Rows("18:18").Hidden = False
    If rookmelder.Value = False Then Rows("19:19").Hidden = True Else Rows("19:19").Hidden = False
    If vochtdetector.Value = False Then Rows("20:20").Hidden = True Else Rows("20:20").Hidden = False
    If bewegingsmelder.Value = False Then Rows("21:21").Hidden = True Else Rows("21:21").Hidden = False
    If trekkoord.Value = False Then Rows("22:22").Hidden = True Else Rows("22:22").Hidden = False
    If handzender.Value = False Then Rows("23:23").Hidden = True Else Rows("23:23").Hidden = False
    If valdetector.Value = False Then Rows("24:24").Hidden = True Else Rows("24:24").Hidden = False
    If alarmeringshorloge.Value = False Then Rows("25:25").Hidden = True Else Rows("25:25").Hidden = False
 
Unload Me

End Sub
These rows will be hidden on startup of the excel sheet:
Private Sub Workbook_Open()
    
ActiveSheet.Rows("15:26").Hidden = True

End Sub
The problem i am countering is the following: when the button is clicked, a set of information (depending on the form input) will be showed. Though for all the 9 options there are 3 rows which are general for all those options. These 3 general rows will be hidden when i click a specific option (because it will only show the options data row, 1 row, and not the general rows) The question is: how can i make my code in such way that when i choose an option, that specific option data will be showed but the general tabs will be showed aswell. And when i click CLEAR on my form (so no options selected) all of my rows will dissapear BUT ALSO the general rows..

I hope i made it clear enough; if i havent here some images to make it a bit clearer:

On load all the rows are hidden (15 till 26):
img 1.png

When i choose an option, the sepecific data will show:
img 2.png

Though what i want to happen is that when i choose an option the GENERAL rows will show aswell, like so:
img 3.png

The problem however is that when i put in the row range 15:26 (hide and unhide) at each IF statement, the IF statements will override eachotter.. And when i clear all, so none of the options is slected, the general row has to hide aswell..

I hope i made my problem a bit clear and sorry for repeating and overexplaining my problem / question (i tend to do that a lot )

Thanks in advance!