ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel function (https://www.excelbanter.com/excel-programming/334280-excel-function.html)

[email protected]

Excel function
 
Hi
How can I create a new function category?
Thanks


Bob Phillips[_6_]

Excel function
 
http://support.microsoft.com/default.aspx?kbid=137526
How to Add a New Category to Function Category List

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
Hi
How can I create a new function category?
Thanks




Darren Hill[_3_]

Excel function
 
On Tue, 12 Jul 2005 16:56:40 +0100, Bob Phillips
wrote:

http://support.microsoft.com/default.aspx?kbid=137526
How to Add a New Category to Function Category List



Neat.
If you create the excel4.0 macro sheet in the personal.xls workbook, can
you use add UDF's contained in other workbooks to that category?
------------------
Darren

Bob Phillips[_6_]

Excel function
 
Once you have setup the category, and added a real UDF to it, you don't need
the Excel4 macro sheet anymore, and you don't need the defined name. You can
just simply add to the category.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Darren Hill" wrote in message
news:op.sttcqvq7ed89cl@omega...
On Tue, 12 Jul 2005 16:56:40 +0100, Bob Phillips
wrote:

http://support.microsoft.com/default.aspx?kbid=137526
How to Add a New Category to Function Category List



Neat.
If you create the excel4.0 macro sheet in the personal.xls workbook, can
you use add UDF's contained in other workbooks to that category?
------------------
Darren




okaizawa

Excel function
 
this is a new feature of Excel 2003.

MacroOptions Method [Excel 2003 VBA Language Reference]
http://msdn.microsoft.com/library/en...roOptions1.asp

in excel 2000, it is difficult to register vba function to a custom
category, because the category number is not fixed.

see also
http://xcell05.free.fr/
(English page)

--
HTH

okaizawa

wrote:
Hi
How can I create a new function category?
Thanks


berimbao78

Excel function
 
Thanks !!
Here's the code I finally used:
Sub Ajoute()

Dim CategName As String
CategName = "MyCateg"

Sheets.Add Type:=xlExcel4MacroSheet
ActiveWorkbook.Names.Add Name:="TmpFunction",
RefersToR1C1:="=Macro1!R1C1", _
Category:="MyCateg", MacroType:=xlFunction

AjouteFonction ("MyFunc")
AjouteFonction ("MyOtherFunc")

Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
End Sub

Sub AjouteFonction(funcName As String)
On Error GoTo err:
For i = 1 To 20
Application.MacroOptions Macro:=funcName, Category:=i
Next i
err:
End Sub
Public Function MyFunc(dbl1 As Double, dbl2 As Double) As Double
MyFunc = dbl1 + dbl2
End Function
Public Function MyOtherFunc(dbl1 As Double, dbl2 As Double) As Double
MyFunc = dbl1 * dbl2
End Function



All times are GMT +1. The time now is 03:03 AM.

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