User your browser to search for the word "upper" on the main message page. It is the 2nd listing after your question.
The code below came from the main message page, see code
This code formats the whole page not just column "E" any ideas on how to fix it?
Private Sub Worksheet_Change(ByVal Target As Range)
'Change col5 to upper case only
Dim rCell As Range
Dim LookRange As Range
Set LookRange = Range("E7", Range("E1000").End(xlUp))
For Each rCell In LookRange
On Error Resume Next
Application.EnableEvents = False
Target = UCase(Target)
Next rCell
Application.EnableEvents = True
End Sub
This code worked it changes a specific column to upper case on enter.
This code finally worked. It changes lower case text to upper case, for one specific column on a sheet, when "Enter" is pressed or the focus moves to a new cell.
Private Sub Worksheet_Change(ByVal Target As Range)
'Change col5 to upper case only
Dim rCell As Range
Dim LookRange As Range
Application.EnableEvents = False
Set LookRange = Range("E7", Range("E1000").End(xlUp))
For Each rCells In Selection
Application.EnableEvents = False
LookRange = UCase(LookRange.Text)
Next
Application.EnableEvents = True
End Sub
Re: This code worked better it came from Bertie.
If you use code in the sheet tab module it must be named the name below. If you put it on a control or on the macro pages you can name it anything you want.
The solution came from Bertie and works like a charm. In my actual application I changed the columns in the code above. So it should work with any column range. Thank's Bertie, JSW.