View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Changing text case in entire database column from JOHN to John

You can use the PROPER function.

Assume first names in Column A and last in Column B.

In C1 enter =PROPER(A1)

In D1 enter =PROPER(B1)

Selecy C1 and D1 then double-click on fill handle of D1.

When happy with results, copy columns C and D the, in place, Paste
SpecialValuesOKEsc.

Delete the original A and B columns.

OR you could use VBA to change all at once in place with no need for formulas.

Sub optProper_Click()
'David McRitchie, programming, 2003-03-07
Dim rng1 As Range, rng2 As Range, bigrange As Range
Dim cell As Range
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
On Error Resume Next
Set rng1 = Intersect(Selection, _
Selection.SpecialCells(xlCellTypeConstants))
Set rng2 = Intersect(Selection, _
Selection.SpecialCells(xlCellTypeFormulas))
On Error GoTo 0
If rng1 Is Nothing Then
Set bigrange = rng2
ElseIf rng2 Is Nothing Then
Set bigrange = rng1
Else
Set bigrange = Union(rng1, rng2)
End If
If bigrange Is Nothing Then
MsgBox "All cells in range are EMPTY"
GoTo done
End If
For Each cell In bigrange
cell.Formula = Application.Proper(cell.Formula)
Next cell
done:
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP


On Tue, 10 Oct 2006 10:18:01 -0700, Kimberly in Palm Springs <Kimberly in Palm
wrote:

I need to change Upper text to Upper and lower text , example JOHN to John,
in entire column. First and last names are in seperate columns typed in excel
spreadsheet. This is for a mail merge.