使用上划线

时间:2015-10-22 14:36:58

标签: excel openxml

我知道有一个公式可供您使用,然后执行以使文本上划线,但单击该文本时看起来很奇怪。使用方程式工具 - 重音和上限工作,但我的字体有限,我需要使用某种字体,而不是Cambria Math。 此外,我想要一个更简单的方法,然后可以从后面的代码生成。

有谁知道如何在Excel中使用上划线编写文本?

1 个答案:

答案 0 :(得分:0)

考虑:

Sub HelloWorld()
   Dim s As String, s2 As String
   s = "HELLOWORLD"
   For i = 1 To Len(s)
      s2 = s2 & Mid(s, i, 1) & ChrW(773)
   Next i

   With ActiveCell
      .Font.Name = "Arial MS Unicode"
      .Value = s2
   End With
End Sub

enter image description here

注意我选择了一种常用的字体。

相关问题