ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Making functions (https://www.excelbanter.com/excel-programming/337451-making-functions.html)

Nicolás

Making functions
 
Good afternoon. I'm programming an Excel function using Visual Basic. My
function works, but I want to add it the yellow squares telling what kind of
arguments should I introduce in a particular position.

For example, if you use (in spanish language) the function BUSCARV, as soon
you open the parenthesis apperars a yellow square that shows:

BUSCARV(valor_buscado, matriz_buscar_en, indicador_columnas, [ordenado])

It's like a help to know the arguments to introduce. I want that my function
shows this kind of yellow square to help user know what kind of information
should he use.

Thank you,

Nicolás

Rowan[_2_]

Making functions
 
I don't think you can add screen tips for a user defined function. The best
you can do is add a description that will show on the Function Arguments
dialog box which the user would access by clicking the Insert Function button
(Fx).

To do this create your function in the VBE. Then open the Object Explorer
(F2). Select VBAProject from the <All Libraries drop down. In the Classes
window select the Module that holds the function. Then right click the
function name in the members window. Select properties and enter your
description.

Note: From what I can see this WILL NOT work if you have already used the
function anywhere in your workbook. The description must be added immediately
after writing the function (Excel 2002 and 2003).

Hope this helps
Rowan

"Nicolás" wrote:

Good afternoon. I'm programming an Excel function using Visual Basic. My
function works, but I want to add it the yellow squares telling what kind of
arguments should I introduce in a particular position.

For example, if you use (in spanish language) the function BUSCARV, as soon
you open the parenthesis apperars a yellow square that shows:

BUSCARV(valor_buscado, matriz_buscar_en, indicador_columnas, [ordenado])

It's like a help to know the arguments to introduce. I want that my function
shows this kind of yellow square to help user know what kind of information
should he use.

Thank you,

Nicolás


Dave Peterson

Making functions
 
Another way to accomplish the same thing.

Back to Excel
tools|macro|macros
type in your function name

then click the Options button
Add your description to that description box.
click ok
then click Cancel

Then you can hit that Fx button (or ctrl-a) after you've typed:
=buscarv(
in the formula bar.

And if you name your variables very nicely, you can type:

=buscarv(
and hit ctrl-shift-a
and you'll see your list of variable names

With nice names, sometimes the Fx/ctrl-a wouldn't be necessary.


Rowan wrote:

I don't think you can add screen tips for a user defined function. The best
you can do is add a description that will show on the Function Arguments
dialog box which the user would access by clicking the Insert Function button
(Fx).

To do this create your function in the VBE. Then open the Object Explorer
(F2). Select VBAProject from the <All Libraries drop down. In the Classes
window select the Module that holds the function. Then right click the
function name in the members window. Select properties and enter your
description.

Note: From what I can see this WILL NOT work if you have already used the
function anywhere in your workbook. The description must be added immediately
after writing the function (Excel 2002 and 2003).

Hope this helps
Rowan

"Nicolás" wrote:

Good afternoon. I'm programming an Excel function using Visual Basic. My
function works, but I want to add it the yellow squares telling what kind of
arguments should I introduce in a particular position.

For example, if you use (in spanish language) the function BUSCARV, as soon
you open the parenthesis apperars a yellow square that shows:

BUSCARV(valor_buscado, matriz_buscar_en, indicador_columnas, [ordenado])

It's like a help to know the arguments to introduce. I want that my function
shows this kind of yellow square to help user know what kind of information
should he use.

Thank you,

Nicolás


--

Dave Peterson


All times are GMT +1. The time now is 02:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com