Hello There,
I have a code which convert the entered text into uppercase for given columns. When I select multiple rows or columns and clear/delete the contents it goes into a infinite loop, and seems it is hanged.
Below is the code. Could you please advice:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Dim aa As Integer
On Error Resume Next
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("H6:H5000,K6:K5000,L6:O5000,Q6:R5000, Q6:R5000, U6:V5000, AF6:AF5000")) Is Nothing Then
If .Value <> "" And _
Not IsNumeric(.cell) And _
Not IsDate(.cell) Then
For Each cell In Target
cell = UCase(cell)
Next
End If
End If
Application.EnableEvents = True
End Sub
Thanks & greetings
Don
I have a code which convert the entered text into uppercase for given columns. When I select multiple rows or columns and clear/delete the contents it goes into a infinite loop, and seems it is hanged.
Below is the code. Could you please advice:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Dim aa As Integer
On Error Resume Next
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("H6:H5000,K6:K5000,L6:O5000,Q6:R5000, Q6:R5000, U6:V5000, AF6:AF5000")) Is Nothing Then
If .Value <> "" And _
Not IsNumeric(.cell) And _
Not IsDate(.cell) Then
For Each cell In Target
cell = UCase(cell)
Next
End If
End If
Application.EnableEvents = True
End Sub
Thanks & greetings
Don