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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
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,215,068
Messages
6,122,950
Members
449,095
Latest member
nmaske

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