View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default VLookup a named range

On Aug 23, 12:55*pm, "Charlotte E." wrote:
I have a named range on a worksheet, called 'TableRange'.

Making a vlookup in a worksheet formula will be like this
=VLOOKUP(F17,TableRange,2,1)

How to do this in VBA???

D = Application.Vlookup(cVal,"TableRange",2,1)
...doesn't work :-(

TIA

CE

You don't need the ,1 parameter as it is the default. See the help
index
= Application.Vlookup(cVal,range("TableRange"),2)
or try
= Application.Vlookup(cVal,[TableRange],2)