The fx button

  • Thread starter Thread starter Robin Clay
  • Start date Start date
R

Robin Clay

Greetings !

Once upon a time... if I entered into a cell the following
(say) -

=MyFunction(

and then clicked on the fx button to the left of the
edit window, I used to be rewarded with a new window that
had slots for every variable that was needed for that
function, and on the left of each appeared the Name that I
had given to that Variable in the code.

Now, however, I still get that window, but it only has
four slots (often not enough) and no variable names.

What has caused this ?

It just MAY be because I moved the entire Module into a
different .xla ? I used to have one .xla with ONLY the
code module (NO actual spreadsheet) and another .xla with
some sheets as well as "Public" code; I have now combined
them, and I THINK the change occurred then (I may be
wrong).

How can I restore the previous situation, but still have
just one .xla ?
 
Hi Robin,
It would be dependent on how many parameters your function has.

The builtin VLOOKUP Worksheet Function for instance has
four possible arguments.

The SUB must have more than four arguments for you to be
able to enter or see more than four. The following will
bring up 5 parameter entry windows.

'arguments 1-2 are required, arguments 3-5 are optional as string
Function test_args(parm1 As String, parm2 As String, _
Optional opt3 As String, Optional opt4 As String, _
Optional opt5 As String) As String
test_args = "-1- " & parm1 & ", -2- " & parm2 & ", -3- " & opt3 _
& ", -4- " & opt4 & ", -5- " & opt5
End Function

=test_args("one","two","three",,"four","five")


Optional Description:
The parameter cell will show up in the Function Wizard Help without
any intervention, so choose your parameter names carefully. The
description can be entered as follows:
Alt+F11 (VBE), F2 (View, Object Browser), Select the module on left,
select the function on right, RClick, properties, fill in description.
 
David McRitchie was so kind as to respond - for which,
many thanks.
The parameter cell will show up in the Function Wizard
Help without any intervention, so choose your parameter
names carefully.

Strange.... I have these Functions in my .xla add-in
library file, which has some worksheets. Everything works
fine.

But if I then load up another file (.xls) and Reference
the .xla file, the FUNCTIONS work fine, but the fx button
doesn't !

ISTR that it worked OK when my .xla had no worksheets.
The description can be entered as follows:
Alt+F11 (VBE), F2 (View, Object Browser), Select the
module on left, select the function on right, RClick,
properties, fill in description.

That doesn't work for me :(

RightClick produces no "Properties" option [ Excel 2002
SP-1 ]

Thanks again.
 
-----Original Message-----
-[ from David McRitchie, 7/29/2003 5:48:52 AM ]-----
Look again, at the complete wording,
you had to TYPE the name of the function
into the Alt+F8 list of macros.

Oooppss ! Sorry....

So I did that, and, when, in a Cell in the .xla
spreadsheet, I typed

=myFunction(

and pressed the fx button, VOILA !
THERE was the description !

However... it DIDN'T work in another spreadsheet, even
though the .xla was referenced and open, and the function
itself works.

Also, it doesn't give the Variable names alongside the
slots. OK, I CAN type it as an explanation as part of the
description, but that's not quite the same...

Thank you for your help.
 
Hi Robin,
Also, it doesn't give the Variable names alongside the
slots. OK, I CAN type it as an explanation as part of the
description, but that's not quite the same...

that's why I include on my page
http://www.mvps.org/dmcritchie/excel/formula.htm#fx
to carefully select the names of parameters.

You will not find .xla referenced in macros and I think that
applies to functions as well. Nor will you see Private
functions and macros.


Robin Clay said:
-----Original Message-----
-[ from David McRitchie, 7/29/2003 5:48:52 AM ]-----
Look again, at the complete wording,
you had to TYPE the name of the function
into the Alt+F8 list of macros.

Oooppss ! Sorry....

So I did that, and, when, in a Cell in the .xla
spreadsheet, I typed

=myFunction(

and pressed the fx button, VOILA !
THERE was the description !

However... it DIDN'T work in another spreadsheet, even
though the .xla was referenced and open, and the function
itself works.

Also, it doesn't give the Variable names alongside the
slots. OK, I CAN type it as an explanation as part of the
description, but that's not quite the same...

Thank you for your help.
 
Back
Top