Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help on help by functions

10 views
Skip to first unread message

Marjan KLJUN

unread,
Oct 4, 2001, 7:18:46 AM10/4/01
to
I have write a simple function whit two parameters which returns a simple
string.

It work's fine.

but if I use Insert function wizard I have no help available about this my
function.

Where can I put this help ???? (description about this parameters)


Thank you

LP
Marjan

Norman Harker

unread,
Oct 4, 2001, 8:03:53 AM10/4/01
to
Hi Marjan!

Please don't crosspost.

Here's the answer given in Programming:

Use:

Tools > Macro > Macros
Type in the name of your function
Press Options
Type in a brief description of your Function
OK
Cancel (Yes! Strange but true!)

When you select that function in the Function Wizard you will now see your
description and that description will also appear in the Function Entry
Dialog.

To attach descriptions of each argument involves another much more complex
approach.

This is the approach used for that task:

Created by Laurent Longre

This example shows how to register functions into user-defined catagories
and
provide descriptions for their arguments. The Auto_Open procedure registers
the two functions, Multiply and Divide in two categories Multiplication and
Division and provides descriptions of the input parameters.

Const Lib = """c:\windows\system\user32.dll"""
Option Base 1

Private Function Multiply(N1 As Double, N2 As Double) As Double
Multiply = N1 * N2
End Function

'==========================================

Private Function Divide(N1 As Double, N2 As Double) As Double
Divide = N1 / N2
End Function

'==========================================

Sub Auto_open()

Register "DIVIDE", 3, "Numerator,Divisor", 1, "Division", _
"Divides two numbers", """Numerator"",""Divisor """, "CharPrevA"
Register "MULTIPLY", 3, "Number1,Number2", 1, "Multiplication", _
"Multiplies two numbers", """First number"",""Second number """, _
"CharNextA"

End Sub

'==========================================

Sub Register(FunctionName As String, NbArgs As Integer, _
Args As String, MacroType As Integer, Category As String, _
Descr As String, DescrArgs As String, FLib As String)

Application.ExecuteExcel4Macro _
"REGISTER(" & Lib & ",""" & FLib & """,""" & String(NbArgs, "P") _
& """,""" & FunctionName & """,""" & Args & """," & MacroType _
& ",""" & Category & """,,,""" & Descr & """," & DescrArgs & ")"

End Sub

'==========================================

Sub Auto_close()

Dim FName, FLib
Dim I As Integer
FName = Array("DIVIDE", "MULTIPLY")
FLib = Array("CharPrevA", "CharNextA")
For I = 1 To 2
With Application
.ExecuteExcel4Macro "UNREGISTER(" & FName(I) & ")"
.ExecuteExcel4Macro "REGISTER(" & Lib & _
",""CharPrevA"",""P"",""" & FName(I) & """,,0)"
.ExecuteExcel4Macro "UNREGISTER(" & FName(I) & ")"
End With
Next

End Sub


hth

"Marjan KLJUN" <marjan...@src.si> wrote in message
news:rAXu7.852$8v1....@news.siol.net...

Marjan KLJUN

unread,
Oct 4, 2001, 8:42:39 AM10/4/01
to
Sorry about crosspost.

I didn't write that this function is in xla (add-in)

I can't see it in tools/macro/

Marjan


"Norman Harker" <nha...@ozemail.com.au> wrote in message
news:3fYu7.15149$bL3.3...@ozemail.com.au...

Norman Harker

unread,
Oct 4, 2001, 9:44:18 AM10/4/01
to
Hi Marjan!

You won't see the function listed when you use Tools > Macro > Macros but if
you then type the name in the top bar, the Option button will become active.

Don't worry about making mistakes here, we're all very friendly and rarely
bite <vbg>. You'll find other tips for new posters at (and a fair amount of
reasons and other useful tips) at:

http://www.cpearson.com/excel/newposte.htm

hth.

"Marjan KLJUN" <marjan...@src.si> wrote in message

news:9PYu7.856$8v1....@news.siol.net...

Marjan KLJUN

unread,
Oct 4, 2001, 10:11:32 AM10/4/01
to
When I typed name of function the run command became active but not OPTION
button.

"Norman Harker" <nha...@ozemail.com.au> wrote in message

news:gJZu7.15221$bL3.3...@ozemail.com.au...

Norman Harker

unread,
Oct 4, 2001, 10:47:18 AM10/4/01
to
Hi Marjan!

I suspect that this is because your xla file in VBE is protected. If this is
the case then:
Access the VBE and
Click on the file in the Project Explorer,
Give the password.
Now back to Excel and you should be able to access options.

hth

"Marjan KLJUN" <marjan...@src.si> wrote in message

news:o6_u7.862$8v1....@news.siol.net...

0 new messages