TRaP
Moderator
Inregistrat: acum 7 ani
Postari: 811
|
|
I have wood sizes defined as text 50x50x50. I want to convert this into a formula, so I want to calculate volume from that text directly. Since i haven't found a good excel formula to do that, with the help of extendoffice.com I solved my problem.
So I want 50x50x50 to convert to =50*50*50 as a formula and show me its value which is 125000, which I can further multiply or divide.
Source:
1. Create a new module in your Personal.xlsb file
2. Insert the following code to create a custom function:
Function Eval(Ref As String) Application.Volatile Eval = Evaluate(Ref) End Function |
3. Here's how I defined the formula in my cell: =EVAL(SUBSTITUTE("="&V2;"x";"*"))
In V2 I have 50x50x50. So I substitute x with * and add an = in front of the resulting text, which is =50*50*50, then I evaluate this text and get the result which is 125000
|
|