Simpatie.ro - matrimoniale
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.
Nou pe simpatie:
mimy_glacier pe Simpatie
Femeie
24 ani
Prahova
cauta Barbat
26 - 47 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[EXCEL] Replace Text with Formula [VBA]

Pagini: 1 Moderat de TRaP, TonyTzu
#1
TRaP
Moderator
Postari: 960
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: https://www.extendoffice.com/documents/ ... rmula.html

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


 
   
#2
TRaP
Moderator
Postari: 960
Supposedly there is an evaluate function in excel that actually works (haven't tested though):
https://www.myonlinetraininghub.com/exc ... e-function


 
   
Pagini: 1  
Mergi la