Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default user defined functions

Dear all,
I wrote an user defined function in excel 2000 to calculate certai
values pertaining to my job as purchase manager for a health programme
The same VBA code works in immediate mode in the VBA editor. But it i
not listed in the list of functions in the formula dialog box (eg Whe
= is typed in a cell) the name of the function is not displayed in th
user defined or custom category.
a)What are the steps to register this function for this worksheet?
b)what should I do to make it available for all other worksheets?
I would appreciate anyhelp in this matter. Could it be that securit
levels for macros have to be changed?

Docmural

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default user defined functions

The UDF must be in a standard code module, not a worksheet class, workbook
class, userform or other class module.

It will be available as long as the workbook with UDF is open, but other
workbooks will need to prefix it with the workbook name. A common practice
is to put in in Personal.xls.

Another approach is to put it in an addin, and install that.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"docmurali " wrote in message
...
Dear all,
I wrote an user defined function in excel 2000 to calculate certain
values pertaining to my job as purchase manager for a health programme.
The same VBA code works in immediate mode in the VBA editor. But it is
not listed in the list of functions in the formula dialog box (eg When
= is typed in a cell) the name of the function is not displayed in the
user defined or custom category.
a)What are the steps to register this function for this worksheet?
b)what should I do to make it available for all other worksheets?
I would appreciate anyhelp in this matter. Could it be that security
levels for macros have to be changed?

Docmurali


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default user defined functions

Unless you make up a reference, you will need to prefix your
user defined macro even though it is in your personal.xls workbook.
=personal.xls!myfunction(A2,C2)

Getting Started with Macros and User Defined Functions
User Defined Functions (#UDF)
http://www.mvps.org/dmcritchie/excel/getstarted.htm#udf

Your own User Defined Functions will appear under the
"User Defined" topic near the bottom of the Paste Function (wizard)
seen as Fx on the toolbar. Since you cannot easily put
a description on each parameter, it would be wise to name
the parameters with meanful names.

Security level should be set to "Medium". A "High" security
level prevents macros and your UDFs from running. If you
are running your macros, you should no problem here.
Tools, macro, security (tab), level set to Medium
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Bob Phillips" wrote ...
The UDF must be in a standard code module, not a worksheet class, workbook
class, userform or other class module.

It will be available as long as the workbook with UDF is open, but other
workbooks will need to prefix it with the workbook name. A common practice
is to put in in Personal.xls.

Another approach is to put it in an addin, and install that.

"docmurali " wrote ...
I wrote an user defined function in excel 2000 to calculate certain
values pertaining to my job as purchase manager for a health programme.
The same VBA code works in immediate mode in the VBA editor. But it is
not listed in the list of functions in the formula dialog box (eg When
= is typed in a cell) the name of the function is not displayed in the
user defined or custom category.
Docmurali




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Defined Functions CH Excel Worksheet Functions 4 September 22nd 08 10:16 AM
User defined functions without using VBA. [email protected] New Users to Excel 0 June 13th 06 05:55 PM
User Defined Functions Mike McLellan Excel Worksheet Functions 2 May 4th 06 10:56 AM
excel functions and User defined functions Kanan Excel Programming 4 May 20th 04 11:21 PM
User Defined Functions Ron Bishop[_2_] Excel Programming 0 November 20th 03 04:20 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"