May 30 2022 10:05 AM
Hi everyone, just a quick question here... It is possible to add help information to a UDF to let the user know how the UDF works and what the possible errors are, and the data is needed for the UDF to function properly?
I want Excel to display that help info like any native formula. If possible...
Appreciate any help you can give me.
May 30 2022 10:46 AM
SolutionYou can use Application.MacroOptions. Here is a very simple example:
Function CelsiusToFahrenheit(t As Double) As Double
CelsiusToFahrenheit = 1.8 * t + 32
End Function
Sub AddDescriptiom()
Application.MacroOptions Macro:="CelsiusToFahrenheit", _
Description:="Convert Celsius to Fahrenheit", _
ArgumentDescriptions:=Array("Temperature in degrees Celsius")
End Sub
Running the AddDescription macro adds a description of the function as a whole and of its arguments. These will be used if you press fx when creating a formula:
May 30 2022 10:57 AM
@Hans Vogelaar extraordinary...! I will try it. Thank you so much...
Aug 03 2022 04:27 PM
Aug 04 2022 02:33 AM
Could you attach a sample workbook (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar? Thanks in advance.
Aug 07 2022 03:50 PM
Aug 07 2022 11:57 PM
If you wish, you can send me a Private Message in this forum. You should be able to attach a sample workbook there.
Aug 08 2022 12:32 PM
I have received your PM. This is what I get when I run the AddDescription macro, then click fx in cell B3:
I have attached the workbook.
Aug 13 2022 03:39 PM
May 30 2022 10:46 AM
SolutionYou can use Application.MacroOptions. Here is a very simple example:
Function CelsiusToFahrenheit(t As Double) As Double
CelsiusToFahrenheit = 1.8 * t + 32
End Function
Sub AddDescriptiom()
Application.MacroOptions Macro:="CelsiusToFahrenheit", _
Description:="Convert Celsius to Fahrenheit", _
ArgumentDescriptions:=Array("Temperature in degrees Celsius")
End Sub
Running the AddDescription macro adds a description of the function as a whole and of its arguments. These will be used if you press fx when creating a formula: