如何在用户定义的函数上放置工具提示 [英] How to put a tooltip on a user-defined function

查看:117
本文介绍了如何在用户定义的函数上放置工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Excel 2007中,如何将描述和参数提示添加到用户定义的函数?当我开始为内置函数键入函数调用时,Excel会显示一个描述和参数列表 - 一个工具提示。我想为我定义的函数做同样的事情。

In Excel 2007, how do I add a description and parameter hints to a user-defined function? When I start typing a function invocation for a built-in function, Excel shows a description and parameter list--a tooltip. I'd like to do the same for the functions I define.

不仅仅是为了配方插入向导,而是在公式框中,所以如果我键= myFun (,在(工具提示就像弹出= average(

Not just for the formula insert wizard, but in the formula box, so if I key "=myFun(", at the "(" the tooltip pops up just like it does for "=average("

在VBA帮助中没有帮助,MSDN上没有任何帮助任何Excel和VBA专用论坛,我可以找到,所以这显然是一个长镜头。

There's no help in VBA Help, none on MSDN and none on any of the Excel and VBA dedicated forums I can find, so this is clearly a long shot.

推荐答案


专业Excel开发
Stephen Bullen描述如何
注册UDF,这允许
描述出现在Function
参数对话框中:

Professional Excel Development by Stephen Bullen describes how to register UDFs, which allows a description to appear in the Function Arguments dialog:



Function IFERROR(ByRef ToEvaluate As Variant, ByRef Default As Variant) As Variant
    If IsError(ToEvaluate) Then
        IFERROR = Default
    Else
        IFERROR = ToEvaluate
    End If
End Function

Sub RegisterUDF()
    Dim s As String
    s = "Provides a shortcut replacement for the common worksheet construct" & vbLf _
    & "IF(ISERROR(<expression>, <default>, <expression>)"

    Application.MacroOptions macro:="IFERROR", Description:=s, Category:=9
End Sub

Sub UnregisterUDF()
    Application.MacroOptions Macro:="IFERROR", Description:=Empty, Category:=Empty
End Sub

来自: http://www.ozgrid.com/forum/showthread.php?t=78123&page=1

要显示功能参数对话框,请键入功能名称,然后按 Ctrl A 。或者,单击公式栏中的fx符号:

To show the Function Arguments dialog, type the function name and press CtrlA. Alternatively, click the "fx" symbol in the formula bar:

这篇关于如何在用户定义的函数上放置工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆