Public Function MyTest(ByRef SelectArea As Range, Optional ByVal CalcWhat As Integer = 1, Optional ByVal ShowHow As Integer = 1, Optional ByVal ErrLabel As String, Optional ByVal DoComments As Boolean = True) As String
' Application.Calculation = xlCalculationManual
' Application.ScreenUpdating = False etc, etc ...
' SpeedOn True
'Debug.Print "Areas.Count: ", SelectArea.Areas.Count, "Cells.Count: ", SelectArea.Cells.Count
'Debug.Print "Val de Cells(1,1): ", SelectArea.Cells(1, 1).Value
'Debug.Print "CalcWhat: ", CalcWhat
'Debug.Print "ShowHow: ", ShowHow
MyTest = "0 plus 0 egal la tete a toto "
End Function
'macro description
Sub UnregisterOptions()
On Error Resume Next
Application.MacroOptions Macro:="MyTest", Description:=Empty, ArgumentDescriptions:=Empty, Category:=Empty
On Error GoTo 0
End Sub
Sub registerOptions()
Dim Funct_description As String, argumtsArray
'(max 255 caracteres)
Funct_description = "Fonction test Fx " & vbCrLf & _
"cette fonction ne sert a rien c'est juste un test" & vbCrLf & _
"Créated By p'tit vieux on Exceldownloads"
'Description des arguments de la fonction
argumtsArray = Array("SelectArea :range ou multi area selectionnées", _
"CalcWhat : ben quoi", _
"ShowHow : ouais!! si tu veux ", _
"ErrLabel : ben ouais ca peut arriver", _
"DoComments : do rien du tout ouais!!")
'appel la sub pour enregistrer
Application.MacroOptions Macro:="MyTest", _
Description:=Mid(Funct_description, 1, 255), _
ArgumentDescriptions:=argumtsArray, _
Category:="personnalisée"
End Sub
'***************************************
'a mettre dans l'open si on veut la description et le formulaire de fonction
Sub auto_open(): registerOptions: End Sub
Sub auto_close(): UnregisterOptions: End Sub
'***************************************