此excel代码不工作。为什么?实际上,我无法使工作任何superscript
代码。我使用Excel 2007
注意: intRow和intColumn是决定行和列的整数。
Cells(intRow, intColumn).Characters(Start:=Len(Cells(intRow, intColumn).Value), Length:=1).Font.Superscript = True
发布于 2015-10-01 17:09:26
我发现了问题。它是细胞的format
。一定是text
。
在superscript
行之前添加该行解决了问题:
Cells(intRow, intColumn).NumberFormat = "@"
谢谢。
发布于 2015-10-01 16:55:51
你需要完全符合你所有的细胞条件。这样做是可行的:
Option Explicit
Public Sub test()
SuperscriptLastLetter 1, 1
End Sub
Public Sub SuperscriptLastLetter(ByVal lngRow As Long, ByVal lngCol As Long)
With ActiveSheet.Cells(lngRow, lngCol)
.Characters(Start:=Len(.Value), Length:=1).Font.Superscript = True
End With
End Sub
https://stackoverflow.com/questions/32892403
复制相似问题