Excel宏:如何选择/处理以上标字符结尾的单元格? [英] Excel macro: how can I select/treat cells with ending superscript charatcers?
问题描述
I'm currenlty putting together an If, ElseIf and Else statement to go through the lists and make it standard. The parts where I'm struggling are those cells where a superscript character has been used at the end of the sentaence for footnote references. These cells need to be given specific line heights different from the standard 10.5.
感谢 marg 有用的If,ElseIf,Else语句.
Thank you marg for the working If, ElseIf, Else statement.
但是我怎么能找到&用结尾处的上标字符对待这些细胞(总是在结尾处?
But how can I find & treat those cells with a superscript character at the end (it's always at the end?
非常欢迎任何指导或指点.
Any guidance or pointers very welcome.
下面的代码不会仅在句子结尾处更新带有上标的单元格.
The code below does not update cells with superscript only at the end of the sentence.
Dim targetCell As Range
...
ElseIf targetCell.font.superscript Then
targetCell.RowHeight = 12.75
...
etc
非常感谢
迈克.
推荐答案
这应该做到.
Sub testForSuperscriptAtEndOfCellValue()
Dim c As Range
For Each c In Range("A:A").Cells
If c.Characters(Len(c), 1).Font.Superscript Then
c.EntireRow.RowHeight = 42
End If
Next c
End Sub
这篇关于Excel宏:如何选择/处理以上标字符结尾的单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!