Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have created a function using VBA (below) which assigns a vlookup value in
the calling cell. Code is below. Function CreateHierachy(AccountParentID As String) As Variant CreateHierachy = "=vlookup(" & AccountParentID & ", $A$2:$G$65536,7,False)" End Function Above code has been simplified. The function retrieves the string "=vlookup(1, $A$2:$G$65536,7,False)" excluding the quotes. I want the cell to read the vlookup value as a formula (not a string). How can I do this within the function? Thanks dudes. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you mean
Function CreateHierachy(AccountParentID As String) As Variant CreateHierachy = Evaluate("=vlookup(" & AccountParentID & _ ", $A$2:$G$65536,7,False)") End Function -- HTH Bob Phillips (remove nothere from email address if mailing direct) "hoppermr" wrote in message ... I have created a function using VBA (below) which assigns a vlookup value in the calling cell. Code is below. Function CreateHierachy(AccountParentID As String) As Variant CreateHierachy = "=vlookup(" & AccountParentID & ", $A$2:$G$65536,7,False)" End Function Above code has been simplified. The function retrieves the string "=vlookup(1, $A$2:$G$65536,7,False)" excluding the quotes. I want the cell to read the vlookup value as a formula (not a string). How can I do this within the function? Thanks dudes. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel lookup functions | Excel Discussion (Misc queries) | |||
Excel Datalist functions / lookup summary | Excel Discussion (Misc queries) | |||
INFORMATION ON FUNCTIONS IN EXCEL (EX. "IF", VALUE LOOKUP) | Excel Worksheet Functions | |||
Excel Lookup Functions | Excel Worksheet Functions | |||
Excel Lookup Functions | Excel Worksheet Functions |