Johnny Thunder
Well-known Member
- Joined
- Apr 9, 2010
- Messages
- 693
- Office Version
- 2016
- Platform
- MacOS
Hello All,
I am working on a dropdown list that will create a formula thru vba to do a validation based on a dropdown list value true or false, true being the range needs to be added to my sum formula.
Here is the dropdown list below, just need help with writing code to do this kind of thing. Any help is appreciated.
So what the code will need to do is
Loop thru each Month Jan - Dec and if the offset value =True then add the range value to a sum formula.
So with the example above my formula should look something like =Sum(M154,N154,O154) based on the months that have the value True.
this formula needs to be dynamic enough to know how many cell ranges to add based on what a user selects as true.
I am working on a dropdown list that will create a formula thru vba to do a validation based on a dropdown list value true or false, true being the range needs to be added to my sum formula.
Here is the dropdown list below, just need help with writing code to do this kind of thing. Any help is appreciated.
Excel Workbook | |||||
---|---|---|---|---|---|
E | F | G | |||
1 | Periods to Validate | True or False | Range | ||
2 | January | FALSE | D154 | ||
3 | February | FALSE | E154 | ||
4 | March | FALSE | F154 | ||
5 | April | FALSE | G154 | ||
6 | May | FALSE | H154 | ||
7 | June | FALSE | I154 | ||
8 | July | FALSE | J154 | ||
9 | August | FALSE | K154 | ||
10 | September | FALSE | L154 | ||
11 | October | TRUE | M154 | ||
12 | November | TRUE | N154 | ||
13 | December | TRUE | O154 | ||
ValidateTBT |
So what the code will need to do is
Loop thru each Month Jan - Dec and if the offset value =True then add the range value to a sum formula.
So with the example above my formula should look something like =Sum(M154,N154,O154) based on the months that have the value True.
this formula needs to be dynamic enough to know how many cell ranges to add based on what a user selects as true.