|
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = True
myStr = Sheet1.Range("A2,A6,A13").Value '如何修改为区域范围如V2:V
For i = 1 To Len(myStr)
wd = Mid(myStr, i, 1)
If Asc(wd) > 47 And Asc(wd) < 58 Then
With Sheet1.Range("A2,A6,A13").Characters(i, 1).Font '如何修改为区域范围如V2:V
.Color = 1
.Size = 16
.Name = "Arial"
End With
ElseIf (Asc(wd) > 64 And Asc(wd) < 91) Or (Asc(wd) > 96 And Asc(wd) < 123) Then
With Sheet1.Range("A2,A6,A13").Characters(i, 1).Font '如何修改为区域范围如V2:V
.Color = 1
.Size = 17
.Name = "Arial"
End With
Else
With Sheet1.Range("A2,A6,A13").Characters(i, 1).Font '如何修改为区域范围如V2:V
.Color = 1
.Size = 19
.Name = "华文楷体"
End With
End If
Next
Application.ScreenUpdating = False
End Sub
|
|