Is it possible to grab logic rules stored in Excel to use in VBA If statement

CLE216

New Member
Joined
May 26, 2017
Messages
14
Hi All,
I am trying to automate updating a series of spreadsheets. The data is a forecast summary. In some worksheets, the data may be rolled up and presented by a family group, others may be by sub-families. In some cases, the top families are summarized individually and the smaller ones are rolled up together, or a family is summarized less one subfamily and then that subfamily is presented alone.

I have mapped out by each group with the file to open, worksheet, UOM column to use, and all of the logic. I would have no issue with having it summarize just individual family or subfamily. But is there a way to store the logic rules for each group in a table with the mapping and use it in my vbacode for the more complicated groups?

For example, to have an if statement set up that uses a variable to refer to a logic string in a cell in each row with the logic such as:
"Family = FamA"
"Subfamily = SubFam1"
"Subfamily = SubFam9 OR Subfamily = SubFam10"
"Family = FamB and Subfamily <> SubFam6"

Family and Subfamily are variable names in the program.

Please let me know if there is anyway to do something like this
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Any one have any thoughts or workarounds? I finished writing the code and it updates all of the files for the ~100 lines that are one full family or subfamily. I still have to manually update each case with special conditions. I can now upate all o he standard lines in under a minute, but it takes over an hour to manually update the last 10 special cases.

Appreciate any thoughts to do this.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top