excel format

P

Pam Coleman

Is there a way that when a user types text in a cell (col A) that if they
type it in small letters it will automatically format to all caps?
 
G

Gord Dibben

Pam

No format available.

You would have to use event code in VBA.

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

As written, operates on Column A as you enter text in any cell in Column A

Change the 1 to whatever you wish.

This is event code and must go into the sheet module.

Right-click on the sheet tab and "View Code". Copy and paste the above into
that module.


Gord Dibben MS Excel MVP
 
M

MDubbelboer

you can convert existing data to uppercase using =upper()

to do it on the fly you'd need to apply a macro as abov
 
Top