Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sentence Case

14 views
Skip to first unread message

julian

unread,
Oct 10, 2001, 11:36:08 PM10/10/01
to
I can use macro to change case to Lower, Upper & Proper case but I
can't seem to change it to Sentence case like in Word. Is it possible
to change it to Sentence case within MS Excel?

regards,
Julian

Orlando Magalhães Filho

unread,
Oct 11, 2001, 12:51:05 AM10/11/01
to
Hi Julian,

You can define an user function like:

Public Function SentenceCase(Stc As String)
SentenceCase = UCase(Left(Stc, 1)) & Right(Stc, Len(Stc) - 1)
End Function

HTH

"julian" <ju...@tm.net.my> escreveu na mensagem
news:3ca7200e.01101...@posting.google.com...

Héctor Miguel

unread,
Oct 11, 2001, 3:01:06 AM10/11/01
to
Also, if you don't need conserving "original" cell's content,
you could permanently convert it using a macro like this:
:
Sub CaseToSentence()
For Each CurrentCell In Selection
CurrentCell.Value = UCase(Left(CurrentCell, 1)) & LCase(Mid(CurrentCell, 2))
Next
End Sub

Regards,
Héctor.


julian

unread,
Oct 12, 2001, 7:22:34 AM10/12/01
to
Problem is, it doesn't work if the cell contains more than 1 sentence.
Any solution to that problem?

regards,
julian


"H?tor Miguel" <oro...@cybercable.net.mx> wrote in message news:<eB7ISHiUBHA.1488@tkmsftngp07>...

John Rischmiller

unread,
Oct 12, 2001, 9:31:48 AM10/12/01
to
If you're confident that Word is also installed then you could use
automation to load the contents to a temporary word document , format it
appropritely and read the data back (and close word afterwards of course).
This can all be transparent to the user, albeit, could be time-consuming.
--
Regards, John,
mailto:jri...@btinternet.com

"julian" <ju...@tm.net.my> wrote in message
news:3ca7200e.01101...@posting.google.com...

Dana DeLouis

unread,
Oct 12, 2001, 11:27:36 AM10/12/01
to
Not sure what you have set up, but could anything here work for you?
Requires Excel 2000 and above...

Sub Test()
Dim v As Variant
Dim S As String
Dim J As Long

[A1] = "this is one sentence. this is another. and this is third
sentence."
S = [A1]
v = Split(S, ".")
For J = 0 To UBound(v)
S = Application.Trim(v(J))
S = StrConv(S, vbLowerCase)
S = UCase(Left$(S, 1)) & Mid$(S, 2)
v(J) = IIf(J > 0, Space(2) & S, S)
Next
[A2] = Application.Trim(Join(v, "."))
End Sub


--
Dana DeLouis Windows Me & Office XP

"julian" <ju...@tm.net.my> wrote in message
news:3ca7200e.01101...@posting.google.com...

julian

unread,
Oct 13, 2001, 8:14:23 AM10/13/01
to
Thanks Dana,
Your solution works. Luv ya ! :)
Regards,
Julian

"Dana DeLouis" <ng_...@hotmail.com> wrote in message news:<uozj4JzUBHA.2076@tkmsftngp03>...

0 new messages