Formatting cells to input in Uppercase only?

TonyW1234

New Member
Joined
Jul 26, 2007
Messages
31
Hi All,

Is there anyway of restricting a cell so that the text has to be typed in in uppercase, I was thinking of using conditional formatting but unsure of how it'd work for this?

Any help would be much appreciated.

Thanks

Tony
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Right click the sheet tab and select View Code. Paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
End Sub

then close the code window. Text entries will be capitalised automatically. It would be possible to restrict this to operate on only a defined range of cells if required.
 
Upvote 1
You could also use data --> validation and specify to allow custom where the formula is =EXACT(A1,UPPER(A1))
 
Upvote 0
Conditional formating with the formula

=EXACT(A1,UPPER(A1)) would do what you want.

This routine in the sheet's code module is much more user friendly
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Cells.Count = 1 Then
    Target.Value = UCase(Target.Value)
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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