auto convert to upper case

  • Thread starter Thread starter Doug Howell
  • Start date Start date
D

Doug Howell

I have some code that will convert any lower case letters entered into
a cell to upper case.

In the following example, I'd like to have this work for the entire G
column, not just cell G5.
How would I do that???


Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False

If Target.Address = "$G$5" Then
Target(1).Value = UCase(Target(1).Value)
End If

Application.EnableEvents = True

End Sub
 
Change this line...

If Target.Address = "$G$5" Then

to this instead...

If Target.Column = 7 Then
 
Back
Top