答案1
前:
代码:
Sub BoldKiller()
Dim L As Long, r As Range, t As String, i As Long
For Each r In Intersect(ActiveSheet.UsedRange, Selection)
t = r.Text
If t <> "" Then
L = Len(t)
For i = L To 1 Step -1
If r.Characters(i, 1).Font.Bold = True Then
r.Characters(i, 1).Delete
End If
Next i
End If
Next r
End Sub
之后:
编辑#1:
此宏提取粗体字符并将它们放在相邻的列中:
Sub BoldKiller2()
Dim L As Long, r As Range, t As String, i As Long
Dim rr As Range
For Each r In Intersect(ActiveSheet.UsedRange, Selection)
t = r.Text
If t <> "" Then
Set rr = r.Offset(0, 1)
rr.Font.Bold = True
L = Len(t)
For i = L To 1 Step -1
If r.Characters(i, 1).Font.Bold = True Then
rr.Value = r.Characters(i, 1).Text & rr.Value
r.Characters(i, 1).Delete
End If
Next i
End If
Next r
End Sub
前:
之后: