I have the following expression in cell A1 which is input
Input:
And I want it to be evaluated as below and displayed in cells in Column B from B1 through B10:Please Login or Register to view this content.
Output:
The input expression is variable and can have several such expressions. How do I approach the VBA macro code?Please Login or Register to view this content.
Basically below are the rules for evaluation:
1) There can only be these operators +, / , +- and brackets.
2) If there is a "+" operator it should be evaluated as a "+" operator only. But will be evaluated for the entire expression each time.
3) If there is a "/" operator it should be expanded for all variables in the expression individually. So an "A/B", should be individually expanded for A and B both.
4) If there is a "+-" operator and there are expressions in bracket, they should be expanded individually as a "+" operator and only once. So +-(C+D) will be evaluated only once but after expansion as +C, +D, +C+D.
Bookmarks