我有很多产品都有描述,包括项目符号,我想将其转换为 html 形式的 excel 文件。
产品描述就像在一个单元格中:
• Our aim is to be devoted to building a sustainable future.
• We are keen to preserve the human being and its environment.
• It is best for all skin types
我尝试过的一些宏代码如下:
Sub aTest()
Dim rCell As Range, spl As Variant, i As Long
For Each rCell In Selection
spl = Split(rCell, Chr(10))
For i = LBound(spl) To UBound(spl)
spl(i) = Chr(60) & "li" & Chr(62) & spl(i) & Chr(60) & "/li" & Chr(62)
Next i
rCell = Join(spl, Chr(10))
Next rCell
Selection.ColumnWidth = 200
Selection.EntireRow.AutoFit
Selection.EntireColumn.AutoFit
End Sub
这段代码给了我输出,包括其中的项目符号:
预期的:
<li> Our aim is to be devoted to building a sustainable future. </li>
<li> We are keen to preserve the human being and its environment.</li>
<li> It is best for all skin types</li>
任何人都可以帮我解决这个问题,因为我对VB一无所知。此外,拥有函数而不是宏会很棒。
谢谢
更新:我将整个内容放在一个单元格中,并希望将其一起转换为 html。那可能吗?
BIODERMA is a brand of NAOS, the world’s number 1 cosmetic company. BIODERMA has been dedicated to skin health for 40 years and has pioneered many breakthroughs in dermatological care. We are a company that provides high-quality skin care products developed by medical professionals with the absolute highest safety standards.
Key Features:
• Our aim is to be devoted to building a sustainable future.
• We are keen to preserve the human being and its environment.
• It is best for all skin types