Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How can I apply a function (PROPER) to multiple cells at once?

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How can I apply a function (PROPER) to multiple cells at once?

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 367
Default How can I apply a function (PROPER) to multiple cells at once?

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 389
Default How can I apply a function (PROPER) to multiple cells at once?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Proper function not updating in cells Richard Champlin Excel Discussion (Misc queries) 2 September 19th 07 03:50 PM
apply a formula to multiple cells FixitFrog Excel Discussion (Misc queries) 3 June 23rd 05 11:54 AM
i want to use the =if function to apply a colour to other cells pookie1970 Excel Worksheet Functions 1 June 20th 05 05:53 PM
How do I apply a combo box to multiple cells in Excel so that it . DB Excel Discussion (Misc queries) 1 January 12th 05 03:42 PM
How to change text in multiple cells from Uppercase to proper cas. Excel help Excel Worksheet Functions 1 November 17th 04 03:45 AM


All times are GMT +1. The time now is 06:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"