|
▼こまおじ さん:
頂いたコメントをヒントに考えてみました
地道に全文字設定し直せばOKのようです。
Sub test()
Dim i As Long, ary() As Boolean
Dim c As Range
Set c = Range("A1")
ReDim ary(1 To Len(c.Characters.Text), 1 To Len(c.Characters.Text))
For i = 1 To UBound(ary)
ary(i, 1) = c.Characters(i, 1).Font.Italic
ary(i, 2) = c.Characters(i, 1).Font.Bold
Next i
For i = 1 To UBound(ary)
With c.Characters(i, 1)
c.Characters(i, 0).Font.Bold = Not ary(i, 2)
.Font.Italic = ary(i, 1)
.Font.Bold = ary(i, 2)
End With
Next i
For i = 1 To UBound(ary)
With c.Characters(i, 1)
If ary(i, 1) Then
.Font.Color = vbRed
.Font.Italic = ary(i, 1)
End If
End With
Next i
End Sub
|
|