Hello Everyone,
This is my first time to the forum and newbie to Excel VBA.
I have a userform labels role_selection with 6 checkboxes. Each checkbox with the caption labels as follow: Revenues, Erevenues, Occupancy, ADR, EADR and RevPAR.
These checkboxes refers to a tab where I have all the datas to hide / unhide
My question is how can i write a program to determine which checkbox is selected (true or false) and hide boxes which are unchecked (and unhide the selected boxes).
I basically need a vba code that I can assign to a command button as follows:
Hide entire columns: AI:AX
If cell BC3 = TRUE, then unhide AJ and AR columns
If cell BC4 = TRUE, then unhide AK and AS columns
If cell BC5 = TRUE, then unhide AL and AT columns
If cell BC6 = TRUE, then unhide AM and AU columns
If cell BC7 = TRUE, then unhide AN and AV columns
If cell BC8 = TRUE, then unhide AO and AW columns
Thanks you very much for your help
This is my first time to the forum and newbie to Excel VBA.
I have a userform labels role_selection with 6 checkboxes. Each checkbox with the caption labels as follow: Revenues, Erevenues, Occupancy, ADR, EADR and RevPAR.
These checkboxes refers to a tab where I have all the datas to hide / unhide
My question is how can i write a program to determine which checkbox is selected (true or false) and hide boxes which are unchecked (and unhide the selected boxes).
I basically need a vba code that I can assign to a command button as follows:
Hide entire columns: AI:AX
If cell BC3 = TRUE, then unhide AJ and AR columns
If cell BC4 = TRUE, then unhide AK and AS columns
If cell BC5 = TRUE, then unhide AL and AT columns
If cell BC6 = TRUE, then unhide AM and AU columns
If cell BC7 = TRUE, then unhide AN and AV columns
If cell BC8 = TRUE, then unhide AO and AW columns
Thanks you very much for your help
Last edited: