在Excel中将用户自定义函数(UDF)添加到内置类别 [英] Add user-defined function (UDF) to built-in category in Excel

查看:237
本文介绍了在Excel中将用户自定义函数(UDF)添加到内置类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将一个公共函数添加到Excel中的标准代码模块时,它将显示在所有类别User Defined中的插入函数向导中。

When I add a public function to a standard code module in Excel it shows up in the Insert Function wizard in the catch-all category "User Defined."

有没有办法:


  1. 将功能保留为public(所以可以从其他模块调用),但将其从Excel函数向导中隐藏?

  2. 使功能出现在内置的类别中(例如财务,统计,逻辑)?

  3. 创建我自己的类别(例如无意义),我的功能出现在那里?

我只需要能够以上情况是有效的,但是我很想知道每个人是否可能。

I only need to be able to make one of the above cases work, but I'd be curious to know if each one is possible.

注意:如果社区觉得更合适。我认为在三个问题中可能只有一个单一的答案,只有轻微的变化。

推荐答案

Application.MacroOptions 是您之后的命令

此示例添加了一个名为 TestMacro 到一个名为我的自定义类别的自定义类别。

This example adds a user-defined macro called TestMacro to a custom category named My Custom Category.

Function TestMacro()
    MsgBox ActiveWorkbook.Name
End Function

Sub AddUDFToCustomCategory()
    Application.MacroOptions Macro:="TestMacro", Category:="My Custom Category"
End Sub

这篇关于在Excel中将用户自定义函数(UDF)添加到内置类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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