G
Guest
Guest
Is it possible to dynamically create a function in a cell?
I know that it is possible to do this for simple functions such as:
ActiveCell.FormulaR1C1 = "=COS(8)"
will set the cell to =COS(8)
However, I would like to make cell A2 contain the function:
=LOOKUP(A1,'[MyFile.xls]AllSites'!$A$4:$A$15,'[MyFile.xls]AllSites'!$B$4:$B$15)
Where I control MyFile.xls via a variable or another cells contents.
I have been able to make the cell contents equal the following TEXT:
"LOOKUP(A1,'[MyFile.xls]AllSites'!$A$4:$A$15,'[MyFile.xls]AllSites'!$B$4:$B$15)"
where MyFile.xls is actually the contents of another cell.
However, this is just text as there is no '=' sign to make it a function.
I can manually select the cell and add the '=' sign and it will work as I want it. Unfortunately, i can't seem to do this automatically.
Any bright ideas people?
Many Thanks.
I know that it is possible to do this for simple functions such as:
ActiveCell.FormulaR1C1 = "=COS(8)"
will set the cell to =COS(8)
However, I would like to make cell A2 contain the function:
=LOOKUP(A1,'[MyFile.xls]AllSites'!$A$4:$A$15,'[MyFile.xls]AllSites'!$B$4:$B$15)
Where I control MyFile.xls via a variable or another cells contents.
I have been able to make the cell contents equal the following TEXT:
"LOOKUP(A1,'[MyFile.xls]AllSites'!$A$4:$A$15,'[MyFile.xls]AllSites'!$B$4:$B$15)"
where MyFile.xls is actually the contents of another cell.
However, this is just text as there is no '=' sign to make it a function.
I can manually select the cell and add the '=' sign and it will work as I want it. Unfortunately, i can't seem to do this automatically.
Any bright ideas people?
Many Thanks.