View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
hoppermr hoppermr is offline
external usenet poster
 
Posts: 7
Default Excel VBA Lookup Functions

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.