G
Guest
I use the following code to automatically change the case of a range of cells
to uppercase in Excel, which works fine.
However I need some other cells in the same sheet to automatically change to
Proper Case. Is there a way of adapting the following code to enable upper
and proper case?
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Range("H1,M5,O11,F7")) Is Nothing Then
With Target
.Value = UCase(.Value)
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
to uppercase in Excel, which works fine.
However I need some other cells in the same sheet to automatically change to
Proper Case. Is there a way of adapting the following code to enable upper
and proper case?
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Range("H1,M5,O11,F7")) Is Nothing Then
With Target
.Value = UCase(.Value)
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub