Thread: change case
View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.misc
PlayingToAudienceOfOne PlayingToAudienceOfOne is offline
external usenet poster
 
Posts: 49
Default change case

Forgot to tell you... to run the module, go to TOOLS MACRO and highlight the
macro "Module7.Change_Case" (by the way, it won't be Module7... it will
number automatically to whatever).

"oldLearner57" wrote:

hi :)
very appreciated for the vba to do the changes,
being a novice in vba, is it possible to guide me in how to use??
did ever requested for this from community & got a very helpful respond
however i loss the page ;(
what i know are as follow:
1st - i insert a module withiin my workbook (inside vbe)
2nd - copied the code as provided
3rd - closed the vbe
4th - how then i can call out the vba code to execute what was written
in the worksheet ? (instead of going to the Macro dialog box ?)

much appreciated if can guide on this :)

thanks to community

-
oldLearner57


"PlayingToAudienceOfOne" wrote:

Copy the following macro:
Sub Change_Case()
Dim ocell As Range
Dim Ans As String
Ans = Application.InputBox("Type in Letter" & vbCr & _
"(L)owercase, (U)ppercase, (S)entence, (T)itles ")
If Ans = "" Then Exit Sub
For Each ocell In Selection.SpecialCells(xlCellTypeConstants, 2)
Select Case UCase(Ans)
Case "L": ocell = LCase(ocell.Text)
Case "U": ocell = UCase(ocell.Text)
Case "S": ocell = UCase(Left(ocell.Text, 1)) & _
LCase(Right(ocell.Text, Len(ocell.Text) - 1))
Case "T": ocell = Application.WorksheetFunction.Proper(ocell.Text)
End Select
Next

End Sub

"oldLearner57" wrote:

hi community

can assist me to solve this ...

example:

A B C
1 living to Eat

2 Eat to LIVE

base on the above A1, I want to change the text to Sentence Case (Capitalise
the 1st lettering)

and in A2, I want to change the text to lower case

any help much appreciated

thanks community for the assistance :)

--
oldLearner57