Say that I have 3 variables (condition1, condition2 and condition3) conditions...thus, 3 Factorial + 2 would get a total of 8 combinations.
For easy understanding, say that each condition value can either be 'Yes' or 'No' (or you can think of it as either 0 or non zero).
Condition 1 |
Condition 2 |
Condition 3 |
Desired Result |
Yes |
No |
No |
Condition 1 ONLY |
Yes |
Yes |
No |
Condition 1 & Condition 2 |
Yes |
No |
Yes |
Condition 1 & Condition 3 |
No |
Yes |
No |
Condition 2 ONLY |
No |
Yes |
Yes |
Condition 2 & Condition 3 |
No |
No |
Yes |
Condition 3 ONLY |
No |
No |
No |
No Condition |
Yes |
Yes |
Yes |
All Condition |
My question is, how do I do in VBA to get which condition to get that result?
For this example, it is only 3 conditions, but the actual, it can be 4 to 6 conditions and thus it is not feasible to think of the many combinations it can get and to write an IF statement for each conditions.
Thus, is there an easier way?
NOTE: Macro works as I wanted. However, if I were to add more 'Sheets', that means that there's more conditions. It is very easy and quick to add more variables. But the difficult part is the IF statement where I need to capture all conditions. Thus, instead of me writing down what each message box will write based on each scenario, I need VBA to know and tell me instead.
Bookmarks