|
发表于 2017-6-14 09:04
|
显示全部楼层
本楼为最佳答案
- Sub tt()
- Dim Ends%, start_num%, str_len%, i%
- Ends = Sheet1.Cells(Rows.Count, 3).End(3).Row
- For i = 5 To Ends
- With Sheet1.Cells(i, 3)
- If .Value Like "*(*)*" Then
- start_num = InStr(.Value, "(") + 1 '开始位
- str_len = InStr(.Value, ")") - InStr(.Value, "(") - 1 '长度
- .Characters(Start:=start_num, Length:=str_len).Font.Color = vbRed '颜色红色
- .Characters(Start:=start_num, Length:=str_len).Font.FontStyle = "加粗" '加粗
- End If
- End With
- Next
- End Sub
复制代码 |
|