Formatting cells to only upper case


John Cutler

Is it possible to pre-format a column of cells as "text" such that any
entered text will automatically be converted to UPPER CASE?

For example, entering lower "x" will be 'forced' by the formatting to
automatically appear as cap "X".

This would be comparable to database software that I use wherein I can
assign a "field input mask" to a data entry field that "forces" all text
entries to UPPER CASE.



John Cutler

A further clarification: I'm NOT speaking here about calculations that use
the =UPPER() function. Instead, I'm concerned about assigning some sort of
input formatting to non-calculated cells so that entered text is converted
within the cell into UPPER CASE.

Thanks -- J

John Cutler

A clarification: I know about the UPPER() function for calculations.
Instead, what I'm asking for here is how to format non-calculated cells to
force entered text to UPPER CASE.


Dave Peterson

If all you're limited to is formatting, then the closest thing you could use is
a font that is all uppercase.

You could use another column with that =upper() worksheet function

or you could use a macro that reacts when someone changes a cell in the range
you want.

Chip Pearson has some event procedure code here:

Chip has some code that same page that you can run on demand.

Gord Dibben

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column <> 8 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
Application.EnableEvents = True
End Sub

Copied to a sheet module.

Gord Dibben MS Excel MVP

Roger Govier

Hi John

Regrettably not.
You could do it though with some event code on your sheet

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Columns("A:E")
If Not Intersect(Target, rng) Is Nothing Then
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
End If
End Sub

In this example, columns A to E inclusive will have their values cahnged
to upper case. You could make rng a single column, or, no contiguous
columns such as ("A", "D", "G")

To use
Copy code above.
Right click on your sheet tab>View code
Paste code into white pane that appears
Alt+F11 to return to Excel

Roger Govier

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