Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a simple function using Evaluate to evaluate a text formula. It
works just fine, even if it references other spreadsheets on the network (the formula has full path). What I can't get it to do properly is have it evaluate an Hlookup referencing another spreadsheet on the network if I have the function look to another cell's text. BUT, if I put the hlookup inside the function, it evaluates just fine. Function I added in VBA: Public Function myFunct(InputString As String) myFunct = Application.Evaluate("=" & InputString) End Function ---------------------------- Formula in A14: =PERSONAL.XLS!myfunct(B14) Evaluates to: #REF! Text in B14: HLOOKUP(L17,'C:\Documents and Settings\eric\My Documents\[Book1.xls]Sheet1'!$E$25:$F$25,1,FALSE) --------------------- Formula in A15: =PERSONAL.XLS!myfunct(HLOOKUP(L17,'C:\Documents and Settings\eric\My Documents\[Book1.xls]Sheet1'!$E$25:$F$25,1,FALSE)) Evaluates properly. ---------------------- Formula in A14: =PERSONAL.XLS!myfunct(B14) Evaluates to: Evaluates properly. Text in B14: HLOOKUP(B8,8:8,1,FALSE) So, it looks like it's something to do w/ the way the function evaluates the text in a cell, versus just passing the text itself into the function. Why??? I want to make dynamic text+formula strings that extensively use hlookup, but if I can't get this to work, it'll be manual updates! Any clues why this one thing doesn't work when it evaluates just fine for other Thanks! ER |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a function that will evaluate a text string in a cell? | Excel Worksheet Functions | |||
Function to evaluate function as string | Excel Worksheet Functions | |||
Evaluate text string as a function | Excel Discussion (Misc queries) | |||
Evaluate string as a formula | Excel Worksheet Functions | |||
how to evaluate the content of a string as if it was a formula | Excel Discussion (Misc queries) |