In my excel VBA program, I have different methods in a class module. I have to pass various parameters as arguments to these methods. Now, I'm passing them as hard coded arguments. What is the better way to do this instead of hard coding? I have used 'Type' to get the values detected thru intellisense in normal modules. How can I achieve these in a better way in class module?
Following pseudo-code is an example. Here, 'state' & 'phase' can be parameters. Each of these parameters can have different values under them.
In the code below, AddFilter method is used to add filter in a pivot table for the parameter passes as arguments. ExcludeItems method is used to remove the items from the pivots added. For example, 1st ExcludeItems will remove 'state1' from the 'state' filter.
Following pseudo-code is an example. Here, 'state' & 'phase' can be parameters. Each of these parameters can have different values under them.
In the code below, AddFilter method is used to add filter in a pivot table for the parameter passes as arguments. ExcludeItems method is used to remove the items from the pivots added. For example, 1st ExcludeItems will remove 'state1' from the 'state' filter.
Code:
AddFilter PvtTbl, "state"
AddFilter PvtTbl, "phase"
ExcludeItems PvtTbl, "state", "state1"
ExcludeItems PvtTbl, "state", "state2"
ExcludeItems PvtTbl, "phase", "phase1"