PC Review


Reply
Thread Tools Rate Thread

Column All Upper Case

 
 
Michael Koerner
Guest
Posts: n/a
 
      15th May 2009
Is there a way to set up say Col F to be all upper case when I type in it. I
would just like to continue to enter data and not have to think that I am
entering a Canadian Postal Code and manually change the text to upper case.
TIA

--

Regards
Michael Koerner



 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      15th May 2009
Right click the tab at the bottom of the worksheet where you want this
functionality, select View Code from the pop up menu that appears, and then
copy/paste the following into the code window that appeared...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
Application.EnableEvents = True
End If
End Sub

Now, go back to your worksheet and type something into Column F in lower
case and watch it change to upper case.

--
Rick (MVP - Excel)


"Michael Koerner" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
> Is there a way to set up say Col F to be all upper case when I type in it.
> I
> would just like to continue to enter data and not have to think that I am
> entering a Canadian Postal Code and manually change the text to upper
> case.
> TIA
>
> --
>
> Regards
> Michael Koerner
>
>
>


 
Reply With Quote
 
Michael Koerner
Guest
Posts: n/a
 
      16th May 2009
Rick;

Absolutely fantastic, that is two in a row you have provided with great
success. Thank you very much.

I do have one question. Would it be possible to change the "If
Target.Column = 6 Then" to read (going out on a limb here) If Target.Column
= 5 or If Target Column=6 Then.... I would like to include column 5 which
contains prov/state

--

Regards
Michael Koerner


"Rick Rothstein" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
Right click the tab at the bottom of the worksheet where you want this
functionality, select View Code from the pop up menu that appears, and then
copy/paste the following into the code window that appeared...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
Application.EnableEvents = True
End If
End Sub

Now, go back to your worksheet and type something into Column F in lower
case and watch it change to upper case.

--
Rick (MVP - Excel)


"Michael Koerner" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
> Is there a way to set up say Col F to be all upper case when I type in it.
> I
> would just like to continue to enter data and not have to think that I am
> entering a Canadian Postal Code and manually change the text to upper
> case.
> TIA
>
> --
>
> Regards
> Michael Koerner
>
>
>



 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      16th May 2009
Yes, you can do that. Here is the statement...

If Target.Column = 5 Or Target.Column = 6 Then

--
Rick (MVP - Excel)


"Michael Koerner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Rick;
>
> Absolutely fantastic, that is two in a row you have provided with great
> success. Thank you very much.
>
> I do have one question. Would it be possible to change the "If
> Target.Column = 6 Then" to read (going out on a limb here) If
> Target.Column
> = 5 or If Target Column=6 Then.... I would like to include column 5 which
> contains prov/state
>
> --
>
> Regards
> Michael Koerner
>
>
> "Rick Rothstein" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> Right click the tab at the bottom of the worksheet where you want this
> functionality, select View Code from the pop up menu that appears, and
> then
> copy/paste the following into the code window that appeared...
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Column = 6 Then
> Application.EnableEvents = False
> Target.Formula = UCase(Target.Formula)
> Application.EnableEvents = True
> End If
> End Sub
>
> Now, go back to your worksheet and type something into Column F in lower
> case and watch it change to upper case.
>
> --
> Rick (MVP - Excel)
>
>
> "Michael Koerner" <(E-Mail Removed)> wrote in message
> news:O%(E-Mail Removed)...
>> Is there a way to set up say Col F to be all upper case when I type in
>> it.
>> I
>> would just like to continue to enter data and not have to think that I am
>> entering a Canadian Postal Code and manually change the text to upper
>> case.
>> TIA
>>
>> --
>>
>> Regards
>> Michael Koerner
>>
>>
>>

>
>


 
Reply With Quote
 
Michael Koerner
Guest
Posts: n/a
 
      16th May 2009
Thanks very much, greatly appreciated.

--

Regards
Michael Koerner


"Rick Rothstein" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
Yes, you can do that. Here is the statement...

If Target.Column = 5 Or Target.Column = 6 Then

--
Rick (MVP - Excel)


"Michael Koerner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Rick;
>
> Absolutely fantastic, that is two in a row you have provided with great
> success. Thank you very much.
>
> I do have one question. Would it be possible to change the "If
> Target.Column = 6 Then" to read (going out on a limb here) If
> Target.Column
> = 5 or If Target Column=6 Then.... I would like to include column 5 which
> contains prov/state
>
> --
>
> Regards
> Michael Koerner
>
>
> "Rick Rothstein" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> Right click the tab at the bottom of the worksheet where you want this
> functionality, select View Code from the pop up menu that appears, and
> then
> copy/paste the following into the code window that appeared...
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Column = 6 Then
> Application.EnableEvents = False
> Target.Formula = UCase(Target.Formula)
> Application.EnableEvents = True
> End If
> End Sub
>
> Now, go back to your worksheet and type something into Column F in lower
> case and watch it change to upper case.
>
> --
> Rick (MVP - Excel)
>
>
> "Michael Koerner" <(E-Mail Removed)> wrote in message
> news:O%(E-Mail Removed)...
>> Is there a way to set up say Col F to be all upper case when I type in
>> it.
>> I
>> would just like to continue to enter data and not have to think that I am
>> entering a Canadian Postal Code and manually change the text to upper
>> case.
>> TIA
>>
>> --
>>
>> Regards
>> Michael Koerner
>>
>>
>>

>
>



 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      16th May 2009
Canadian postal codes like a space between 3rd and 4th character.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column <> 7 Then Exit Sub 'adjust column to suit
On Error GoTo ErrHandler
Application.EnableEvents = False
With Target
.Formula = UCase(Target.Formula)
.Value = (Left(Target.Value, 3) & " " & Right(Target.Value, 3))
End With
ErrHandler:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 15 May 2009 16:37:06 -0400, "Michael Koerner" <(E-Mail Removed)>
wrote:

>Is there a way to set up say Col F to be all upper case when I type in it. I
>would just like to continue to enter data and not have to think that I am
>entering a Canadian Postal Code and manually change the text to upper case.
>TIA


 
Reply With Quote
 
Michael Koerner
Guest
Posts: n/a
 
      16th May 2009
Coming from Ottawa I automatically put in the space <g>

--

Regards
Michael Koerner


"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news:(E-Mail Removed)...
Canadian postal codes like a space between 3rd and 4th character.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column <> 7 Then Exit Sub 'adjust column to suit
On Error GoTo ErrHandler
Application.EnableEvents = False
With Target
.Formula = UCase(Target.Formula)
.Value = (Left(Target.Value, 3) & " " & Right(Target.Value, 3))
End With
ErrHandler:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 15 May 2009 16:37:06 -0400, "Michael Koerner" <(E-Mail Removed)>
wrote:

>Is there a way to set up say Col F to be all upper case when I type in it.
>I
>would just like to continue to enter data and not have to think that I am
>entering a Canadian Postal Code and manually change the text to upper case.
>TIA



 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      17th May 2009
Coming from a small town in B.C. I do the same when hand entering on an
envelope.

When entering in a worksheet I just let the event code do it all.


Gord

On Sat, 16 May 2009 16:53:49 -0400, "Michael Koerner" <(E-Mail Removed)>
wrote:

>Coming from Ottawa I automatically put in the space <g>


 
Reply With Quote
 
Michael Koerner
Guest
Posts: n/a
 
      17th May 2009
After a good nights sleep, your suggestion really made a lot of sense. thank
you very much.

But, when I tried to insert the macro you provided, I received a compile
error indicating I had an ambiguous statement.

I also have a couple of questions. The column with the postal code is column
6. Your macro I believe indicated <>7 I would also like to have column 5 if
possible in Upper Case as this is the prov/state column.

--

Regards
Michael Koerner


"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news:(E-Mail Removed)...
Coming from a small town in B.C. I do the same when hand entering on an
envelope.

When entering in a worksheet I just let the event code do it all.


Gord

On Sat, 16 May 2009 16:53:49 -0400, "Michael Koerner" <(E-Mail Removed)>
wrote:

>Coming from Ottawa I automatically put in the space <g>




 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      17th May 2009
A worksheet cannot have multiple events of the same type.

Different types...........yes.........same type........no.

Sounds like you have more than one worksheet_change event in that sheet
module.

Either combine or change one of them to a different type.

BTW...............postal codes are in column 6...........is column 5 simply
province names?

I can't imagine you want the same format on both columns in that case.

Assumes you enter a province name in column 5 then a postal code in column 6

After the column 6 entry the code will run on both columns.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Range(Target(1).Address), _
Range("F:F")) Is Nothing Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
With Target
.Formula = UCase(Target.Formula)
.Value = (Left(Target.Value, 3) & " " & Right(Target.Value, 3))
End With
With Target.Offset(0, -1)
.Formula = UCase(.Formula)
End With
ErrHandler:
Application.EnableEvents = True
End Sub


Gord

On Sun, 17 May 2009 06:51:15 -0400, "Michael Koerner" <(E-Mail Removed)>
wrote:

>After a good nights sleep, your suggestion really made a lot of sense. thank
>you very much.
>
>But, when I tried to insert the macro you provided, I received a compile
>error indicating I had an ambiguous statement.
>
>I also have a couple of questions. The column with the postal code is column
>6. Your macro I believe indicated <>7 I would also like to have column 5 if
>possible in Upper Case as this is the prov/state column.


 
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
How to set Upper case in a column ilyaz Microsoft Excel Discussion 12 27th Sep 2008 08:52 PM
change data of entire column from small case to upper case Ann Microsoft Excel Worksheet Functions 1 16th Aug 2008 01:06 PM
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
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 change a column in Excel from upper case to lower case? =?Utf-8?B?RGViYmllIEtlbm5lZHk=?= Microsoft Excel Worksheet Functions 3 2nd May 2005 06:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:37 AM.