Hello There,
I have the below code to capitalize entered text in specific range of cells and it works good.
The problem is when I delete or insert chunk of rows or columns, the below code gets fired and uses quite a bit of the memory (the laptop fan noise shoots up).
What I would like is the below code to fire only while entering the cell values and not during insert/delete of rows and columns.
Could you please advise.
Thanks & regards
Don
I have the below code to capitalize entered text in specific range of cells and it works good.
The problem is when I delete or insert chunk of rows or columns, the below code gets fired and uses quite a bit of the memory (the laptop fan noise shoots up).
What I would like is the below code to fire only while entering the cell values and not during insert/delete of rows and columns.
Could you please advise.
Thanks & regards
Don
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
'converts texts into upper case for selected columns
If Not Application.Intersect(Target, Range("H6:H5000,K6:K5000")) Is Nothing Then
Application.EnableEvents = False
For Each cell In Intersect(Target, Range("H6:H5000,K6:K5000"))
If Not cell.HasFormula Then
cell.Value = UCase(cell)
End If
Next
Application.EnableEvents = True
End If
End Sub