在Excel中使用Alt + Enter替换HTML标签(< / br>) [英] Replace HTML tag(</br>) with Alt+Enter in Excel

查看:217
本文介绍了在Excel中使用Alt + Enter替换HTML标签(< / br>)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VBA,但是我有一个如何用Alt + Enter替换HTML标签的问题。例如,如果我输入一个句子:Hello World。在Excel的外壳中,我按Alt + Enter键进入Hello和World之间。然后我想把它复制到别的地方,我复制后显示如下:HelloWorld。任何帮助都会感激。

I am working on VBA, but I have one problem of how to replace a tag of HTML with Alt+Enter. For example, If I type a sentence: Hello World. In shell of Excel, I press on Alt+Enter to Enter between Hello and World. Then I want to copy it to somewhere else that after I copied it shows like: HelloWorld. Any help would be appreciate.

推荐答案

< br> 在HTML中只是给你一个换行符。

The <br> tag in HTML just gives you a line break.

在VBA中,你可以使用 vbNewLine 常量来完成同样的事情。

In VBA, you can accomplish the same thing using the vbNewLine constant.

替换函数将派上用场。

The Replace function will come in handy for this.

Dim input As String
input = "Hello<br>World!"

Dim result As String
result = Replace$(input, "<br>", vbNewLine)

这篇关于在Excel中使用Alt + Enter替换HTML标签(&lt; / br&gt;)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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