I found the following code to automatically change lower case in specified cells to upper case. It does work, however if I clear more than one cell at a time I get an error "Run-time error '13': Type mismatch."
In addition to the error message, after debugging, the code doesn't work anymore until I enable events TRUE in the Immediate Window, or close and reopen the workbook.
Any ideas?
In addition to the error message, after debugging, the code doesn't work anymore until I enable events TRUE in the Immediate Window, or close and reopen the workbook.
Any ideas?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Application.Intersect(Target, Range("A2:A150")) _
Is Nothing) Then
With Target
If Not .HasFormula Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End With
End If
End Sub