auto convert to upper case

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
 
R

Rick Rothstein

Change this line...

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

to this instead...

If Target.Column = 7 Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top