View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Vlookup result in a message box

Howard,
You can't 'assign' a return value to the MsgBox function. I'm not
sure you can do this even for the Prompt WITHIN the function but you
can try...

MsgBox Prompt:=Application.IfError(VLookup(currName, rngLook, 2,
False), "Game?")


A more conventional approach might be...

Dim sPrompt$
sPrompt = Application.IfError(VLookup(currName, rngLook, 2, False),
"Game?")

MsgBox sPrompt

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion