Data tables in Excel are really nice to see how numbers would evolve if one of your input changes. However:
- they're (very) slow
- the variable you edit is not dynamic; i.e. changing the row or column input cell to
=INDIRECT(<dynamic address>)works but doesn't update if the dynamic adress changes. - they force you to use an annoying structure
- the variable needs to be in the same sheet as the table
Because I want to do a lot of them, point 1 and 2 make it very impractical to work with data tables. Is there any way to make a function that does this in VBA? I tried a UDF that changes the variable's value (e.g. =whatif(<hypothetical output>, <variable cell>, <variable hypothetical value>), but that's not allowed in VBA (see How to prevent VBA function from re-executing inside the code).