'portable' UDFs ???

W

whelanj

Morning All,

Created some UDFs for my spreadsheets here at the office. Didn't kno
they don't save with the spreadsheet. The boos opens my works an
enters some new data, and I look like an idiot because my function
don't work. How can I get them to save with the spreadsheet? Help!

Thank
 
N

Norman Harker

Hi Whelanj!

You can create the UDF in the workbook itself.

Alternatively you can put them in a file which you save as an Addin.
With this approach the Addin must be installed and selected as an
Addin in all computers which run the workbook.
 
W

whelanj

Hey Norman,

"You can create the UDF in the workbook itself."

I read about this on other sites but I don't know how to do it exactly.
I thought I had it done but it didn't work. Can you give me a
step-by-step? Thanks
 
W

whelanj

Just in case anyone's wondering, the Add-In (using two files) is no
really an option for what I want to do
 
N

Norman Harker

Hi Whelanj

Open your workbook
Right click on a sheet tab [You're now in the Visual Basic Editor]
In the top left window, select your workbook
Right click the workbook name
Insert > Module

[You'll now find that you have a Module 1 in your project and the code
window for that Module will be active]

Type the following:

Function LIFE()
LIFE = 42
End Function

Click on the Excel symbol at left of the Toolbar
In an empty cell use:

=LIFE()
It should return 42

Save your workbook.
Close and re-open and re-test.
Close workbook

Now test that workbook on another computer.

I understand your subsequent post. Very often it is just not desirable
or convenient to use an Addin and is easier to put the UDFs in modules
in the workbook that you want to use them in.
 

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