View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
LuisE LuisE is offline
external usenet poster
 
Posts: 133
Default Range to VLOOKUP as a Variable (range in another file)

I need to do a VLOOKUP in a close file which name I'm getting from a variable
named FileToOpen using GetOpenFilename.

My problem starts when I try to add the the Sheet and the range to the
formula. The sheet name is UK and it'll be looking up from Column A to Column
E.

Here is what I have (not working obviously)

ActiveCell.FormulaR1C1 = _
'"=VLOOKUP(RC[-9]," & "[" & FileToOpen & "]" & "UK!C1:C5" & " ,5,FALSE)"

Thanks in advance