PC Review


Reply
Thread Tools Rate Thread

adding a user defined function to the library

 
 
aa
Guest
Posts: n/a
 
      9th Mar 2007
In Excel-2000 in the list of function categories there is "user defined"
category.
If I have written a function how do I add it to the list?
Also in which language this function is to be written?
Is this a script or a compiled language?


 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      9th Mar 2007
You write the function in VBA - it differs from a macro in returning
one result, and can't affect formatting of cells. It is normally used
in the worksheet it is written for, but you could save it to your
Personal.xls to make it more widely available. If you had a lot of
them, then you could set them up as an add-in. You would use it in a
worksheet like:

=my_function(parameter list)

to return a particular result.

Do a search of these newsgroups looking for UDF and you will see many
other examples.

Hope this helps.

Pete

On Mar 9, 5:32 pm, "aa" <A...@aa.com> wrote:
> In Excel-2000 in the list of function categories there is "user defined"
> category.
> If I have written a function how do I add it to the list?
> Also in which language this function is to be written?
> Is this a script or a compiled language?



 
Reply With Quote
 
aa
Guest
Posts: n/a
 
      9th Mar 2007
Thanks, it helps

If it is VBA - do I need to compile it?
Where do I save the function to be used in a particular worksheet?
"Pete_UK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You write the function in VBA - it differs from a macro in returning
> one result, and can't affect formatting of cells. It is normally used
> in the worksheet it is written for, but you could save it to your
> Personal.xls to make it more widely available. If you had a lot of
> them, then you could set them up as an add-in. You would use it in a
> worksheet like:
>
> =my_function(parameter list)
>
> to return a particular result.
>
> Do a search of these newsgroups looking for UDF and you will see many
> other examples.
>
> Hope this helps.
>
> Pete
>
> On Mar 9, 5:32 pm, "aa" <A...@aa.com> wrote:
> > In Excel-2000 in the list of function categories there is "user defined"
> > category.
> > If I have written a function how do I add it to the list?
> > Also in which language this function is to be written?
> > Is this a script or a compiled language?

>
>



 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      9th Mar 2007
A quick Google search for UDF in this newsgroup revealed 240+
responses. Here is one from Gord Dibben on 7th December 2003 which
answers most of the points:

" ...

1. UDF's and Macros can be stored in a workbook so they are available
only
for that workbook.


2. They can be stored in a Personal Macro Workbook that is placed in
the
XLSTART folder so they are available for all open workbooks.


3. They can be stored in a workbook which has been saved as an Add-in
with
the extension *.XLA


I prefer putting my macros/functions into a personal Add-in(*.XLA) and
having
that loaded whenever Excel is opened.


The reason I favor the Add-in route is that you rarely have a problem
with
Excel finding the macros/functions when referred to by name only,
without
preceding with Personal.xls.!


One minor problem with an Add-in is that the macros don't show up in
the
Tools>Macro>Macros list.


The UDF's you write will be available in the Function Wizard in
"User Defined" category.


If you have no Personal.xls one can be built easily.


On menu go to Tools>Macro>Record New Macro.


You will be presented with a dialog box with Macro1 as name of macro.
Below
that is "Store macro in". Select Personal Macro Workbook.


Record something simple like copying a cell and pasting. Stop
Recording.
Close Excel and you will be asked if you want to save changes to
Personal.xls


Click Yes. Excel will save it to your XLSTART folder.


You now have a Personal.xls which will open each time you start
Excel. When it is open, you can go to Windows>Hide and make it
hidden. Save
changes again. The macros you create will be available to work in
all
workbooks.


At any time Personal.xls can be saved as an Add-in through File>Save
As>Type>Excel Add-in(*.xla) and stored in the Office\Library folder.
It will
then show up in the list in Tools>Add-ins to be checked.


Gord Dibben

.... "

Hope this helps.

Pete


On Mar 9, 6:48 pm, "aa" <A...@aa.com> wrote:
> Thanks, it helps
>
> If it is VBA - do I need to compile it?
> Where do I save the function to be used in a particular worksheet?"Pete_UK" <pashu...@auditel.net> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > You write the function in VBA - it differs from a macro in returning
> > one result, and can't affect formatting of cells. It is normally used
> > in the worksheet it is written for, but you could save it to your
> > Personal.xls to make it more widely available. If you had a lot of
> > them, then you could set them up as an add-in. You would use it in a
> > worksheet like:

>
> > =my_function(parameter list)

>
> > to return a particular result.

>
> > Do a search of these newsgroups looking for UDF and you will see many
> > other examples.

>
> > Hope this helps.

>
> > Pete

>
> > On Mar 9, 5:32 pm, "aa" <A...@aa.com> wrote:
> > > In Excel-2000 in the list of function categories there is "user defined"
> > > category.
> > > If I have written a function how do I add it to the list?
> > > Also in which language this function is to be written?
> > > Is this a script or a compiled language?- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
aa
Guest
Posts: n/a
 
      10th Mar 2007
Thanks a lot


 
Reply With Quote
 
aa
Guest
Posts: n/a
 
      11th Mar 2007
On my computer I have two XLSTART folders:
C:\Documents and Settings\?????????????\Application
Data\Microsoft\Excel\XLSTART (this folder contains one file called
PDFMaker.xla)
and
C:\Program Files\Microsoft Office\Office\XLStart (also with one file called
PDFMaker.xla)

Which one shall I use?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding help to a user defined function Diarmuid Microsoft Excel Programming 4 6th Jan 2008 05:55 PM
User defined function - adding names chillihawk Microsoft Excel Programming 4 1st Jun 2006 07:54 AM
Adding user-defined function Tim Microsoft Access VBA Modules 5 15th Oct 2003 12:46 AM
Adding user-defined function in Excel2002 jimlyke Microsoft Excel Worksheet Functions 2 3rd Oct 2003 05:31 PM
Adding a pop-up help to a user-defined function james s shoenfelt Microsoft Excel Programming 1 26th Sep 2003 03:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 AM.