So that I can be clear. Are you saying that in the 'example vlookup file' you want to be able to enter
='some udf name'(A1)
instead of the longer
=VLOOKUP(A1,'[example list.xlsx]Sheet1'!$A$1:$B$6,2,0)
i.e. you're simply wanting to reduce the typing effort.
In which case I don't see that a UDF offers any advantage over a standard function, and UDF's of course have their own limitations.
It seems to me this boils down to creating the VLOOKUP formula in the simplest way, and a simple macro attached to either a button you click or a sheet event macro - perhaps one that reacts to a new entry of a code would be the most straightforward.
The attached uses the following macro which will populate the city when you enter the city ref. in column A
Another option of course would be to hold the master VLOOKUP formula somewhere and have the macro copy and paste it
Bookmarks