Excel宏:如何选择/处理以上标字符结尾的单元格? [英] Excel macro: how can I select/treat cells with ending superscript charatcers?

查看:34
本文介绍了Excel宏:如何选择/处理以上标字符结尾的单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在拼凑一个

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屋!

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