Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In , Jake
spake thusly: I have a sheet with two columns of names, entered in uppercase letters. I need to loop through a given range of cells and change the case permanently to normal 'name' convention (first character uppercase and the rest lowercase) for each word in each cell. Jake, Names are hard. There are zillions of exceptions. But for a "quick solution" as you asked: Sub TitleCase() Dim myCell As Range Dim myRight As String For Each myCell In ActiveSheet.UsedRange myRight = Right(myCell, Len(myCell) - 1) myCell = UCase(Left(myCell, 1)) & LCase(myRight) Next End Sub Needs embellishment for all sorts of aforesaid exceptions (e.g., John Van der Kamp) and perhaps needs error handling added. =dman= |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop through columns | Excel Programming | |||
Loop through Columns | Excel Programming | |||
loop over columns | Excel Discussion (Misc queries) | |||
loop through columns | Excel Programming | |||
Loop 20 columns Help! | Excel Programming |