代码
1
Function
GetColorChar(Rng
As
Range)
2 Application.Volatile True
3 Dim i%, str $
4 For i = 1 To Len (Rng)
5 If Rng.Characters(i, 1 ).Font.Color = 255 Then
6 str = str & Mid (Rng.Value, i, 1 )
7 End If
8 Next
9 GetColorChar = str
10 End Function
2 Application.Volatile True
3 Dim i%, str $
4 For i = 1 To Len (Rng)
5 If Rng.Characters(i, 1 ).Font.Color = 255 Then
6 str = str & Mid (Rng.Value, i, 1 )
7 End If
8 Next
9 GetColorChar = str
10 End Function
效果如下图: