vba 在 Microsoft Excel 中显示格式化的 HTML 文本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20927966/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 01:12:44  来源:igfitidea点击:

Displaying formatted HTML text in Microsoft Excel

htmlexcelvba

提问by Tim Mitchell

I need to display text with html tags within a Microsoft Excel spreadsheet.

我需要在 Microsoft Excel 电子表格中显示带有 html 标签的文本。

I need

我需要

<strong>This should appear in bold - but you should not see the strong tags</strong>

<strong>This should appear in bold - but you should not see the strong tags</strong>

to appear in a cell of the spreadsheet as bold-faced text - without strong tags at the beginning and end.

在电子表格的单元格中显示为粗体文本 - 在开头和结尾没有强标记。

This should appear in bold - but you should not see the strong tags

这应该以粗体显示 - 但您不应该看到强标签

回答by ex-man

i do not think excel supports this. the only way is to write some vba code that does it for you... maybe there is an addin available that does that job

我不认为 excel 支持这一点。唯一的方法是编写一些 vba 代码来为你做这件事......也许有一个插件可以完成这项工作

try this:

尝试这个:

HTML Text with tags to formatted text in an Excel cell

带有标记的 HTML 文本,用于 Excel 单元格中的格式化文本