简体   繁体   English

excel可以VBA UDF输出格式化文本吗?

[英]excel can VBA UDF output formatted text?

Is there a way to return a string from an UDF formatted? 有没有办法从UDF格式返回一个字符串? For example I would like first two words to be bold, the rest not. 例如,我希望前两个单词是粗体,其余的不是。

Functions are not allowed to alter the formatting of the worksheet. 不允许函数更改工作表的格式。 That being said, Sub() can and you can easily write a Sub routine that does this - it just means you'll have to run the macro (like using F8) instead of entering it as a formula inside a cell. 话虽这么说,Sub()可以并且您可以轻松编写一个执行此操作的Sub例程 - 它只是意味着您必须运行宏(如使用F8)而不是将其作为单元格内的公式输入。

抱歉,您无法将富文本格式应用于公式的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM