Auto Upper Case

J

jamphan

Is it possible to have cells to automatically change the text to all
Upper case. I know there is a formula but I want it to change when the
user types in text and goes to another cell it will change to all caps.
 
J

Jim Rech

The only way to do what you want is with a macro. This article describes
how a Selection_Change macro works:

http://support.microsoft.com/kb/305565/en-us

but, instead of the code in step 4, you've have:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range

'Set the range for the formatting changes to A1:A5.
Set r = Intersect(Range("A1:A5"), Target)

'If the change in the worksheet is not in the tested range, exit the
macro.
If r Is Nothing Then Exit Sub

'Change for uppercasing:
Application.EnableEvents = False
r.Value = UCase(r.Value)
Application.EnableEvents = True

End Sub

In the above code only cells in the range A1:A5 would be uppercased. If you
wanted the entire sheet affected you'd get rid of the Set and If lines and
use Target.Value = UCase(Target.Value)

--
Jim
message |
| Is it possible to have cells to automatically change the text to all
| Upper case. I know there is a formula but I want it to change when the
| user types in text and goes to another cell it will change to all caps.
|
|
| --
| jamphan
| ------------------------------------------------------------------------
| jamphan's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=20105
| View this thread: http://www.excelforum.com/showthread.php?threadid=498428
|
 

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