PC Review


Reply
Thread Tools Rate Thread

auto convert to upper case

 
 
Doug Howell
Guest
Posts: n/a
 
      10th Nov 2009
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
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      10th Nov 2009
Change this line...

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

to this instead...

If Target.Column = 7 Then

--
Rick (MVP - Excel)


"Doug Howell" <(E-Mail Removed)> wrote in message
news:03b547fc-1b11-4372-9d38-(E-Mail Removed)...
>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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert lower to upper case automatically without using UPPER Sal Microsoft Excel Misc 6 26th Jul 2009 11:27 AM
convert upper case text to lower case with the first letter upper =?Utf-8?B?Skg=?= Microsoft Access Macros 1 20th Aug 2006 09:07 PM
How to convert lower case index entry tag to upper case? =?Utf-8?B?WXVyaSBJdmFub3Y=?= Microsoft Word Document Management 3 31st Jul 2006 10:55 PM
excel'03 how to convert a column from upper case to proper case =?Utf-8?B?c2hhcmllIHBhbG1lcg==?= Microsoft Excel Misc 1 30th Jan 2006 11:50 PM
How do I convert all upper case excel sheet into upper and lower . =?Utf-8?B?RGViRGF5?= Microsoft Excel Misc 1 9th Mar 2005 08:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:07 PM.