Help with UDF

N

NH

I am writing a UDF where I would like to get the name from the customer
master file by entering the customer code. the master file is in drive
F:\util\....
like a vlookup function and the function looks like ..
=custname(A1)

1)What is the equivalent of vlookup in vb script?
2) How do I use his in all spreadsheets instead of the specific one?
 
M

mangesh_yadav

1. Application.WorksheetFunction.VLookup()
2. You can use the udf in any sheet as you have given the example

- Manges
 
B

Bernie Deitrick

NH,
2) How do I use his in all spreadsheets instead of the specific one?

Save the workbook where the code resides as an addin (an XLA file), and
install the addin through Tools | Addins....

OR

Save the function code in your Personal.xls, in which case you would enter
the function as

=Personal.xls!FunctionName()

rather than just

=FunctionName()

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top