Format text to ALL CAPS

Rick M

New Member
Joined
Feb 21, 2002
Messages
44
How do I Format a cell to either change any text to CAPS or require the User to input in CAPS?
Thanks.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
If cell A1 has the following text: testing
And cell B1 has the following formula: upper(A1)
Then B1 will then say TESTING.

Does this help?
 
Upvote 0
One more option to have people enter upper case:

Use data validation. Select custom and enter the formula
=EXACT(A1,UPPER(A1))
for cell A1.

You can also add creative input and error messages here. Note, this will not stop someone from pasting in lower case values, but it will stop them from typing in lower case values.
 
Upvote 0
If you want to do this with VB code paste the following in to worsheet VB section. This will capitalize in cells A1 to D10

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:D10")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
Application.EnableEvents = True
End Sub

Dave
 
Upvote 0
Hi All
Sorry to resurrect such an old thread but this is exactly what I am looking for but I cannot seem to get this to work.
Steps taken:
Open VBA pane by right clicking tab and clicking View Code
Copy/paste the code above vba pane
Change Range to be C4:C100 (I want only column c to have caps)
Type value in c 4 (or 5,6,7,etc.) but the letters remain lower case.

I have gone to the trust settings and set the Enable Macros but still nothing
Suggestions?
 
Upvote 0
Go to VBA editor. Press view then immediate window. Paste in:

Application.EnableEvents = True

Press enter. Does it work now?
 
Upvote 0
If you want to do this with VB code paste the following in to worsheet VB section. This will capitalize in cells A1 to D10

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:D10")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
Application.EnableEvents = True
End Sub

Dave

Thank You, Dave! This worked exactly how I wanted. You made a beginner proud.

Country Gal
 
Upvote 0
Sorry to resurrect this old thread again but I want to apply this to two separate ranges. How would I do this?

Thanks,
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,228
Members
448,951
Latest member
jennlynn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top