Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Format Cell - first letter upper case
Is there a way to format a cell so that when I type in "john" it wil
display as "John" Or if I type in "jOhN" it will display as "John" The PROPER function works if I refernce it to another cell. I also want to format a cell to display a Canadian Postal Code so tha when I type "v9t5t1" it will display as "V9T 5T1" with a space betwee the T and the 5. Thank you -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Format Cell - first letter upper case
Worksheet event code
Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Columns(1)) Is Nothing Then With Target .Value = WorksheetFunction.Proper(.Value) End With End If ws_exit: Application.EnableEvents = True End Sub Right-click the sheet tab, select View Code, and paste the code in. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "i8theburger " wrote in message ... Is there a way to format a cell so that when I type in "john" it will display as "John" Or if I type in "jOhN" it will display as "John" The PROPER function works if I refernce it to another cell. I also want to format a cell to display a Canadian Postal Code so that when I type "v9t5t1" it will display as "V9T 5T1" with a space between the T and the 5. Thank you. --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Format Cell - first letter upper case
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Format Cell - first letter upper case
Hi
you have to put it in a worksheet module (as Bob has described it). What problem did you exactly encounter? -- Regards Frank Kabel Frankfurt, Germany I cannot get that code to work? --- Message posted from http://www.ExcelForum.com/ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Format Cell - first letter upper case
I followed his directions. Then when I type a word into any cell, I ge
a Microsoft Visual Basic dialog box pop up saying Compile error Expected: expression When I click the ok button, the word event is highlighted in the code -- Message posted from http://www.ExcelForum.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Format Cell - first letter upper case
Hi
sounds like you also pasted the first line of Bob's posting. Just insert the lines between the dashed lines below: '---------- Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Columns(1)) Is Nothing Then With Target .Value = WorksheetFunction.Proper(.Value) End With End If ws_exit: Application.EnableEvents = True End Sub '--------------- -- Regards Frank Kabel Frankfurt, Germany I followed his directions. Then when I type a word into any cell, I get a Microsoft Visual Basic dialog box pop up saying Compile error: Expected: expression When I click the ok button, the word event is highlighted in the code? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Upper Case Letters to First Letter Upper, Remaining Letters Lower | Excel Discussion (Misc queries) | |||
1st letter upper case | Excel Discussion (Misc queries) | |||
Format cell to convert to Upper case | Excel Discussion (Misc queries) | |||
how do I format a cell to display its contents in Upper case? | Excel Discussion (Misc queries) | |||
How do I change Letter case (lower to Upper) in a spreadsheet??? | Excel Discussion (Misc queries) |