Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Upper & Lowercase

I have a last name column in which some of the names are
in all uppercase. Is there a way to change all the names
to where only the first character is uppercase and the
rest of the name is in lower case.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Upper & Lowercase

Lynn, or if you want to use a macro you could do it without having to add a
column, select the range you want to change before you run this macro

Sub Proper_Case()
'select the range you want to change
'and run this macro
Application.ScreenUpdating = False
Dim Rng As Range
For Each Rng In Selection.Cells
If Rng.HasFormula = False Then
Rng.Value = Application.WorksheetFunction.Proper(Rng.Value)
End If
Next Rng
Application.ScreenUpdating = True
End Sub


--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
"Lynn" wrote in message
...
I have a last name column in which some of the names are
in all uppercase. Is there a way to change all the names
to where only the first character is uppercase and the
rest of the name is in lower case.

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Upper & Lowercase

Hi Lynn,
You say that some of the cells have all caps, it the other cells
are correct you may not want to apply a proper case macro
to those cells. If they are better than you would get with a macro
you might want to include an additional test
If rng.value = ucase(rng.value) then
ooo current replacement line ooo
end if

There is a macro on my page
http://www.mvps.org/dmcritchie/excel/proper.htm
that attempts to take care of names like McRitchie and de Bruin
where you have to code your own exceptions for some names.

You would invoke the macro Proper_case,
but you would need both macros: Proper_case() and proper_case_inner()

The purpose of splitting the macro was to be able to process
a different selection range from within another macro, but usage
would be transparent..

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Paul B" wrote in message ...
Lynn, or if you want to use a macro you could do it without having to add a
column, select the range you want to change before you run this macro

Sub Proper_Case()
'select the range you want to change
'and run this macro
Application.ScreenUpdating = False
Dim Rng As Range
For Each Rng In Selection.Cells
If Rng.HasFormula = False Then
Rng.Value = Application.WorksheetFunction.Proper(Rng.Value)
End If
Next Rng
Application.ScreenUpdating = True
End Sub


--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
"Lynn" wrote in message
...
I have a last name column in which some of the names are
in all uppercase. Is there a way to change all the names
to where only the first character is uppercase and the
rest of the name is in lower case.

Thanks!





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
Filtering on upper/lowercase letters Chris Benton Excel Worksheet Functions 3 May 3rd 23 07:46 PM
Filtering/sorting on upper/lowercase Chris Benton Excel Worksheet Functions 0 February 13th 09 03:41 PM
Upper to Lowercase in Excel Beth Excel Worksheet Functions 7 July 17th 08 04:35 PM
convert a range of lowercase text to upper text or vice versa jackdaw Excel Worksheet Functions 2 May 16th 05 09:31 PM
How do I convert all upper case excel sheet into upper and lower . DebDay Excel Discussion (Misc queries) 1 March 9th 05 08:31 PM


All times are GMT +1. The time now is 10:47 AM.

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

About Us

"It's about Microsoft Excel"