convert text RC formula in a cell

D

Dim

Hi
i need to pick up a text formula (in RC format without equal sign)
from lookup table based on set of different paramenters and apply it
to the datatable (about 50K rows) for specific columns using formula
within a cell without looping using VBA..
for example lookup table might look like that:
AAA then formula RC3+RC25*RC30
ABC then formula RC2/RC20*RC4

i tried to break the process on two steps using intermedia column with
lookup formula to bring text RC formula into dataset table and then in
calculated column convert it into formula so that Excel can recognize
and does calc ..But i can't find the way to convert without using VBA
and looping through the whole column (50K rows takes a tons of time to
do so)

in the code I can loop through the whole dataset one by one using
VLookUP, assing RC formula found in the lookup table to a variable :
strFormula=Vlookup(A1, LookupTable-Range, 2, false) and then
attach it to a each specific cell : Cell.formula= "=" & strFormula.

How i can achive it in the cell without a code ?

cheers
D.
 
T

Tom Ogilvy

You can not achieve it in a cell without the code.

but you don't have to loop if the formula will be the same for every row
strFormula=Vlookup(A1, LookupTable-Range, 2, false)
Range("F2:F50000").FormulaR1C1 = "=" & sStrFormula
 
D

Dim

Tom Ogilvy said:
You can not achieve it in a cell without the code.

but you don't have to loop if the formula will be the same for every row
strFormula=Vlookup(A1, LookupTable-Range, 2, false)
Range("F2:F50000").FormulaR1C1 = "=" & sStrFormula

Tom, the way U suggested does not create any benefit as i would need
to LOOP through each row at least once :
if I put lookup formula into intermedia column (assume F):
Vlookup(RC1, LookupTable-Range, 2, false)
i will bring RC formula from lookup into datatable
that formula is still TEXT...to attach it to "=" i HAVE to HAVE use
vba loop to assing that text to string (strFormula) and for each row
that string is different, which means I will be forced for the
following:
for each cl in RangeColumn-F
cl.offset(0,1).formula="=" & strFormula (that's what i'm trying
to do avoiding code)
next cl
your way won't make a trick
Range("F2:F50000").FormulaR1C1 = "=" & sStrFormula

unless u tell me that
Range("G2:G50000").FormulaR1C1 = "=" & RC8 can be worked out (column F
contains text RC formula which we can use in column G)
cheers
D.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top