Excel - AYUDA EN FUNCIONES DE USUARIO

 
Vista:

AYUDA EN FUNCIONES DE USUARIO

Publicado por _frany_ (62 intervenciones) el 29/11/2008 00:13:44
Hola a todos, de nuevo.

Me gustaria saber si es posible colocar ayuda a las funciones creadas por el usuario.

por ejemplo me creo una funcion sencilla a modo de ejemplo que calcula el area de un cuadrado dandole el lado.

Function area_cuadrado(l)
area_cuadrado = l * l
End Function

Como puedo hacer para que me aparezca una ayuda de que hace la funcion al igual que las funciones que incorpora Excel?

Muchas gracias y un saludo a todos.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:AYUDA EN FUNCIONES DE USUARIO

Publicado por Luis Fernando (803 intervenciones) el 30/11/2008 16:27:23
Mira Fran, una ves tengas ya tu función, entras por VER MACROS y aunque ahi no te permita elegir el nombre tubunción de lista alguna, escribes en el recuadro "Nombre de la Macro" el nombre de tu función y cuando este nombre esté escrito exactamente a como lo tienes en la funcion, se activarán varias funciones incluida la de opciones que es por donde puedes darle una descripción que luego se verá como ayuda de tu función.


Cordial saludo desde Pereira Colombia.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AYUDA EN FUNCIONES DE USUARIO

Publicado por _frany_ (62 intervenciones) el 30/11/2008 20:00:48
Muchisimas gracias por la respuesta.

Funciona pero no me permite poner ayuda a los argumentos.

Sabes si aparte de esto se puede poner ayuda adicional.

De todas formas con esto me sirve puesto que al menos me indica que hace la funcion.

Gracias y un saludo.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de JuanC

RE:AYUDA EN FUNCIONES DE USUARIO

Publicado por JuanC (1237 intervenciones) el 30/11/2008 20:52:16
http://www.jkp-ads.com/articles/RegisterUDF00.asp

http://www.j-walk.com/ss/excel/eee/eee009.txt

Saludos desde Baires, JuanC
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AYUDA EN FUNCIONES DE USUARIO

Publicado por _frany_ (62 intervenciones) el 01/12/2008 21:16:16
Muchisimas gracias JuanC

La verdad que el segundo link no he podido realizar lo que quiero.

El primero me soprepasa, funciona a la perfeccion pero va mas alla de mis conocimientos.

Tambien es cierto que está en ingles y no lo comprendo al 100% y veo que es necesario mucho codigo para algo que en principio creia que era mas simple.

Es realmente necesario todo ese codigo?

De todas formas muchisimas gracias como siempre a tu inestimable ayuda.

un saludo.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de JuanC

RE:AYUDA EN FUNCIONES DE USUARIO

Publicado por JuanC (1237 intervenciones) el 01/12/2008 21:58:05
que curioso, el segundo link es mucho más simple y anda perfecto!
acá va un poco de info con más detalles del tema, que por cierto es complejo...
Macro Sheets Only
Registers the specified dynamic link library (DLL) or code resource and returns the register ID. You can also specify a custom function name and argument names that will appear in the Function Wizard. If you register a command (macro_type = 2), you can also specify a shortcut key. Because Microsoft Excel for Windows and Microsoft Excel for the Macintosh use different types of code resources, REGISTER has a slightly different syntax form when used in each operating environment.
For more information about DLLs and code resources, see the "Using the CALL and REGISTER Functions" in the Appendix for the Worksheet Function Reference, or Using the CALL and REGISTER Functions in online Help.
Important This function is provided for advanced users only. If you use the CALL function incorrectly, you could cause errors that will require you to restart your computer.
Syntax 1
For Microsoft Excel for Windows
REGISTER(module_text, procedure, type_text, function_text, argument_text, macro_type, category, shortcut_text, help_topic, function_help, argument_help1, argument_help2,...)

Syntax 2

For Microsoft Excel for the Macintosh
REGISTER(file_text, resource, type_text, function_text, argument_text, macro_type, category, shortcut_text, help_topic, function_help, argument_help1, argument_help2,...)
Module_text or file_text is text specifying the name of the DLL that contains the function (in Microsoft Excel for Windows) or the name of the file that contains the code resource (in Microsoft Excel for the Macintosh).
Procedure or resource is text specifying the name of the function in the DLL (in Microsoft Excel for Windows) or the name of the code resource (in Microsoft Excel for the Macintosh). In Microsoft Excel for Windows, you can also use the ordinal value of the function from the EXPORTS statement in the module-definition file (.DEF). In Microsoft Excel for the Macintosh, you can also use the resource ID number. The ordinal value or resource ID number should not be in text form.
This argument may be omitted for stand-alone DLLs or code resources. In this case, REGISTER will register all functions or code resources and then return module_text or file_text.
Type_text is text specifying the data type of the return value and the data types of all arguments to the DLL or code resource. The first letter of type_text specifies the return value. The codes you use for type_text are described in "Using the CALL and REGISTER Functions" in the Appendix for the Worksheet Function Reference, or Using the CALL and REGISTER Functions in online Help.For stand-alone DLLs or code resources (XLLs), you can omit this argument.
Function_text is text specifying the name of the function as you want it to appear in the Function Wizard. If you omit this argument, the function will not appear in the Function Wizard.
Argument_text is text specifying the names of the arguments you want to appear in the Function Wizard. Argument names should be separated by commas.
Macro_type specifies the macro type: 1 for a function or 2 for a command. If macro_type is omitted, it is assumed to be 1 (function).
Category specifies the function category in the Function Wizard in which you want the registered function to appear. You can use the category number or the category name for category. If you use the category name, be sure to enclose it in double quotation marks. If category is omitted, it is assumed to be 14 (User Defined).

Category number Category name
1 Financial
2 Date & Time
3 Math & Trig
4 Text
5 Logical
6 Lookup & Matrix
7 Database
8 Statistical
9 Information
10 Commands (macro sheets only)
11 Actions (macro sheets only)
12 Customizing (macro sheets only)
13 Macro Control (macro sheets only)
14 User Defined

Shortcut_text is a character specifying the shortcut key for the registered command. The shortcut key is case-sensitive. This argument is used only if macro_type = 2 (command). If shortcut_text is omitted, the command will not have a shortcut key.
Help_topic is the reference (including path) to the help file that you want displayed when the user chooses the Help button when your custom function is displayed.
Function_help is a text string describing your custom function when it is selected in the Function Wizard. The maximum number of characters is 255.
Argument_help1, argument_help2 are 1 to 21 text strings that describes you custom function's arguments when the function is selected in the Function Wizard.
Example
Syntax 1
In Microsoft Excel for Windows, the following macro formula registers the GetTickCount function from Microsoft Windows. This function returns the number of milliseconds that have elapsed since Microsoft Windows was started.

REGISTER("User", "GetTickCount", "J")
Assuming that the REGISTER function is in cell A5, after your macro registers GetTickCount, you can use the CALL function to return the number of milliseconds that have elapsed:
CALL(A5)
Example
Syntax 1 with optional function_text
You can use the following macro formula to register the GetTickCount function from Microsoft Windows and assign the custom name GetTicks to it. To do this, include "GetTicks" as the optional function_text argument to the REGISTER function.

REGISTER("User", "GetTickCount", "J", "GetTicks", , 1, 9)
After the function is registered, the custom name GetTicks will appear in the Information function category (category = 9) in the Function Wizard.
You can call the function from the same macro sheet on which it was registered using the following formula:
GetTicks()
You can call the function from another sheet or macro sheet by including the name of the original macro sheet in the formula. For example, assuming the macro sheet on which GetTicks was registered is named MACRO1.XLS, the following formula calls the function from another sheet:
MACRO1.XLS!GetTicks()
Tip You can use functions in a DLL or code resource directly on a sheet without first registering them from a macro sheet. Use syntax 2a or 2b of the CALL function. For more information, see CALL.

Saludos desde Baires, JuanC
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AYUDA EN FUNCIONES DE USUARIO

Publicado por _frany_ (7 intervenciones) el 02/12/2008 20:35:45
Pues será que estoy haciendo algo mal puesto que no he conseguido hacer que funcione con el codigo del segundo link.

Probaré de nuevo por si es un error mio.

Muchas gracias.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar