Help Required.

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.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top