Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Tanya321 pe Simpatie.ro
Femeie
24 ani
Giurgiu
cauta Barbat
24 - 63 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL] Replace Text with Formula [VBA] Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 748
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


pus acum 6 ani
   
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 748
Supposedly there is an evaluate function in excel that actually works (haven't tested though):

pus acum 6 ani
   
Pagini: 1  

Mergi la