excelnoob001
New Member
- Joined
- Jul 24, 2019
- Messages
- 26
I am creating an userform that have checkboxes users can tick off, and then press select files.
I already have working code that corresponds to each of the checkboxes users can select, however I want to know if there's an efficient way to do this process.
For example, let's say user wants to check off checkboxes A and B, then press select files. This will enable the macro to go to sheets A and B and extract data from a source file onto those sheets.
However, what if the user wants to select many checkboxes? (I have 9 checkboxes total)
My solution was to simply have countless if loops that will deal with every possible combination of checkboxes a user can select, which is like 9 factorial.
(9x8x7x6x5x4x3x2) However, that obviously would be too tedious and not efficient.
Is there an efficient way to create an if loop that will encapsulate every possible combination of checkboxes a user can select?
Thank you!
I already have working code that corresponds to each of the checkboxes users can select, however I want to know if there's an efficient way to do this process.
For example, let's say user wants to check off checkboxes A and B, then press select files. This will enable the macro to go to sheets A and B and extract data from a source file onto those sheets.
However, what if the user wants to select many checkboxes? (I have 9 checkboxes total)
My solution was to simply have countless if loops that will deal with every possible combination of checkboxes a user can select, which is like 9 factorial.
(9x8x7x6x5x4x3x2) However, that obviously would be too tedious and not efficient.
Is there an efficient way to create an if loop that will encapsulate every possible combination of checkboxes a user can select?
Thank you!