Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Format cell to convert to Upper case
Is there a way to format an individual cell/column so that what is typed in
that cell is automatically shown as Upper case? ei: x7898 would show as X7898 no matter how it was typed. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Format cell to convert to Upper case
Hi,
Right click your sheet tab, view code and paste this in. Works on Column A only but that can be changed to any range Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 Then If Not Target.HasFormula Then Target = UCase(Target) End If End If End Sub Mike "widman" wrote: Is there a way to format an individual cell/column so that what is typed in that cell is automatically shown as Upper case? ei: x7898 would show as X7898 no matter how it was typed. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Format cell to convert to Upper case
Include this as the first line
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub Mike "widman" wrote: Is there a way to format an individual cell/column so that what is typed in that cell is automatically shown as Upper case? ei: x7898 would show as X7898 no matter how it was typed. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Format cell to convert to Upper case
You cannot format a cell to achieve this.
You would use a helper cell with the formula =UPPER(A1) Or sheet event code. 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 Right-click on the sheet tab and "View Code". Copy/paste the event code into that module. Edit to suit........as written, works only on column A When done editing, Alt + q to return to Excel. Gord Dibben MS Excel MVP On Fri, 30 May 2008 14:04:00 -0700, widman wrote: Is there a way to format an individual cell/column so that what is typed in that cell is automatically shown as Upper case? ei: x7898 would show as X7898 no matter how it was typed. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Format cell to convert to Upper case
Gord,
I used your example once and it worked. It seems I may have done something to where it will no longer work. Could the enable events turned off or something? I have no clue what that means but I have almost pulled my hair out trying to figure out why it won't do what it just did? Any thoughts on this problem? -- David P. "Gord Dibben" wrote: You cannot format a cell to achieve this. You would use a helper cell with the formula =UPPER(A1) Or sheet event code. 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 Right-click on the sheet tab and "View Code". Copy/paste the event code into that module. Edit to suit........as written, works only on column A When done editing, Alt + q to return to Excel. Gord Dibben MS Excel MVP On Fri, 30 May 2008 14:04:00 -0700, widman wrote: Is there a way to format an individual cell/column so that what is typed in that cell is automatically shown as Upper case? ei: x7898 would show as X7898 no matter how it was typed. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I format a cell to display its contents in Upper case? | Excel Discussion (Misc queries) | |||
excel'03 how to convert a column from upper case to proper case | Excel Discussion (Misc queries) | |||
Convert lower case charecters to upper case | Excel Discussion (Misc queries) | |||
convert ot upper case | Excel Discussion (Misc queries) | |||
How do I convert all upper case excel sheet into upper and lower . | Excel Discussion (Misc queries) |