tags:

views:

30

answers:

1

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.

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

Many thanks

Mike.

+2  A: 

This should do it.

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
Lunatik
Like a charm! Do you know how to find line breaks as well? I think I just need to refresh the screen (at the start probably) so those cells with line break expand to fit the text.
Mike
Best to ask in a separate question.
Lunatik