Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
have a "database" of names and addresses completely in uppercase letters and
need to format it with the PROPER function so I can use it to print address labels. No problem doing this for one cell, but have thousands of names and am wondering if there is a way to do this globally for a range of cells |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
From David McRithchie comes this macro.
Sub Proper_Case() '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 Sun, 2 Dec 2007 16:17:01 -0800, AGrozier wrote: have a "database" of names and addresses completely in uppercase letters and need to format it with the PROPER function so I can use it to print address labels. No problem doing this for one cell, but have thousands of names and am wondering if there is a way to do this globally for a range of cells |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You could do that in VBA:
Sub MyProper() Application.ScreenUpdating = False Dim myrange As Range Set myrange = ActiveSheet.UsedRange For Each cell_ In myrange If cell_ < "" Then cell_.Value = Application.WorksheetFunction.Proper(cell_.Value) Debug.Print cell_.Address End If Next cell_ Application.ScreenUpdating = True End Sub you can change myrange to whatever you want. hth Carlo On Dec 3, 9:17 am, AGrozier wrote: have a "database" of names and addresses completely in uppercase letters and need to format it with the PROPER function so I can use it to print address labels. No problem doing this for one cell, but have thousands of names and am wondering if there is a way to do this globally for a range of cells |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
This works in one fell swoop:
Dim r As Range Set r = ActiveSheet.UsedRange r.Value = Application.Proper(r.Value) -- Tim Zych SF, CA "AGrozier" wrote in message ... have a "database" of names and addresses completely in uppercase letters and need to format it with the PROPER function so I can use it to print address labels. No problem doing this for one cell, but have thousands of names and am wondering if there is a way to do this globally for a range of cells |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Proper function not updating in cells | Excel Discussion (Misc queries) | |||
apply a formula to multiple cells | Excel Discussion (Misc queries) | |||
i want to use the =if function to apply a colour to other cells | Excel Worksheet Functions | |||
How do I apply a combo box to multiple cells in Excel so that it . | Excel Discussion (Misc queries) | |||
How to change text in multiple cells from Uppercase to proper cas. | Excel Worksheet Functions |