ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Custom Function VLookup (https://www.excelbanter.com/excel-discussion-misc-queries/77543-custom-function-vlookup.html)

Martin

Custom Function VLookup
 
Hello,

Can anyone tell me if this custom function could work like this or I must
define anything alse ?:

Function CustomVLookup(valuename)
CustomVLookup = VLookup(valuename, A1:B1, 2, False)
End Function

Thanks

Tom Ogilvy

Custom Function VLookup
 
Sure you want A1:B1?

why not try

=if(A1<Valuename,na(),B1)

anyway,

Function CustomVLookup(valuename)
CustomVLookup = Evaluate("VLookup(" & _
Valuename & ", A1:B1, 2, False)
End Function

Good change this will not recalculate if you change anything in A1:B1



--
Regards,
Tom Ogilvy


"Martin" wrote:

Hello,

Can anyone tell me if this custom function could work like this or I must
define anything alse ?:

Function CustomVLookup(valuename)
CustomVLookup = VLookup(valuename, A1:B1, 2, False)
End Function

Thanks



All times are GMT +1. The time now is 08:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com