Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I tried several posted macros for Sentence Case to make every first letter of every sentence in a cell - Capital one. No success. Every time I get the same result: #NAME? Is there any easy way to do that? Thanks, Alex |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
(Source: http://www.angelfire.com/biz7/julian...ans_macros.htm)
<To change text in a selected range to sentence case use this code. This code was supplied by Simon Huggins. Sub SentenceCase() For Each cell In Selection.Cells s = cell.Value Start = True For i = 1 To Len(s) ch = Mid(s, i, 1) Select Case ch Case "." Start = True Case "?" Start = True Case "a" To "z" If Start Then ch = UCase(ch): Start = False Case "A" To "Z" If Start Then Start = False Else ch = LCase(ch) End Select Mid(s, i, 1) = ch Next cell.Value = s Next End Sub "Alex" wrote: Hi, I tried several posted macros for Sentence Case to make every first letter of every sentence in a cell - Capital one. No success. Every time I get the same result: #NAME? Is there any easy way to do that? Thanks, Alex |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Sheeloo,
You saved my life, the code is simple and works just great. Thanks again... "Sheeloo" wrote: (Source: http://www.angelfire.com/biz7/julian...ans_macros.htm) <To change text in a selected range to sentence case use this code. This code was supplied by Simon Huggins. Sub SentenceCase() For Each cell In Selection.Cells s = cell.Value Start = True For i = 1 To Len(s) ch = Mid(s, i, 1) Select Case ch Case "." Start = True Case "?" Start = True Case "a" To "z" If Start Then ch = UCase(ch): Start = False Case "A" To "Z" If Start Then Start = False Else ch = LCase(ch) End Select Mid(s, i, 1) = ch Next cell.Value = s Next End Sub "Alex" wrote: Hi, I tried several posted macros for Sentence Case to make every first letter of every sentence in a cell - Capital one. No success. Every time I get the same result: #NAME? Is there any easy way to do that? Thanks, Alex |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I change case to sentence case in groups in excel? | Excel Discussion (Misc queries) | |||
Change the text from lower case to upper case in an Excel work boo | Excel Discussion (Misc queries) | |||
How to change case on a spreadsheet from Caps to Sentence? | Excel Discussion (Misc queries) | |||
Change Capitals to Sentence Case | Excel Discussion (Misc queries) | |||
Excell should have a sentence case function like the UPPER() and . | Excel Worksheet Functions |