LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default using vlookup in a custom function

Thanks for the advice. I'm now struggling to understand how to define
the external range. So far I have this but the result is "#VALUE!"

Function MyLookUp(Acronym As Range, Fieldname As Range) As Variant
Dim R21Data As Range
Dim R21Fields As Range
Dim wbk As Workbook
Set wbk = Workbooks.Open(Filename:= _
"http://intranet/yesterday/Report21.xls")
Set R21Data = wbk.Worksheets("Data").Range("$A$7:$DV$1954")
Set R21Fields = wbk.Worksheets("Data").Range("$A$7:$DV$7")
MyLookUp = Application.VLookup(Acronym, R21Data,
Application.Match(Fieldname, R21Fields, 0), False)
End Function

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible -- a custom format on text, similar to a VLOOKUP() function? Randy Harmelink Excel Programming 1 November 3rd 06 12:32 AM
Custom function to simplify vlookup formula John James Excel Programming 3 March 15th 06 09:39 PM
Custom Function VLookup Martin Excel Discussion (Misc queries) 1 March 15th 06 08:32 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM


All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"