1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Private Sub Worksheet_Change(ByVal Target As Range)
Dim cel As Range
For Each cel In Target
With cel
If Not Intersect(Target, [G2:H27]) Is Nothing Then
If .Count <> 1 Then Exit Sub
If cel = "" Then
.Font.ColorIndex = 1
.Font.Bold = False
Else
Application.EnableEvents = False
.Font.ColorIndex = 1
.Font.Bold = False
With .Characters(1, 1)
.Font.ColorIndex = 3
.Font.Bold = True
If Not IsNumeric(Left(cel.text, 1)) Then
.text = UCase(.text)
End If
End With
Application.EnableEvents = True
End If
End If
End With
Next
End Sub |