#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Proper Case

Excel 2003.

Select all text cells with text and get Proper Case.

Is there a built in way to Proper Case text?

Or how do I do it?



--- news://freenews.netfront.net/ - complaints: ---
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Proper Case

Hi,

Am Fri, 15 Nov 2013 10:53:11 -0800 schrieb OldGuy:

Select all text cells with text and get Proper Case.


try:

Sub Makro1()
Dim rngC As Range

With ActiveSheet
For Each rngC In .UsedRange.SpecialCells(xlCellTypeConstants, 2)
rngC = WorksheetFunction.Proper(rngC)
Next
End With
End Sub


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Proper Case

Put this in a standard module of your PERSONAL.XLS and use it anytime
you need to change case...

Sub ProperCase()
Application.ScreenUpdating = False
For Each c In Selection: c.Value = Application.Proper(c.Value): Next
End Sub

Here's a few more in case you're interested in adding a custom menu to
your formatting toolbar:

Sub UpperCase()
Dim c
Application.ScreenUpdating = False
For Each c In Selection: c.Value = UCase(c.Value): Next
End Sub

Sub LowerCase()
Dim c
Application.ScreenUpdating = False
For Each c In Selection: c.Value = LCase(c.Value): Next
LCase(Mid(c.Value, 2)): Next
End Sub

Sub SentenceCase()
Dim c
Application.ScreenUpdating = False
For Each c In Selection.Cells
s = c.Value
Start = True
For i = 1 To Len(s)
Ch = Mid(s, i, 1)
Select Case Ch
Case ".", "?": Start = True
Case "a" To "z": If Start Then Ch = UCase(Ch): Start = False
Case "A" To "Z": If Start Then Start = False Else Ch =
LCase(Ch)
End Select
Mid(s, i, 1) = Ch
Next
c.Value = s
Next
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

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
Change Upper Case to Proper Case Michael Koerner Excel Programming 5 March 6th 08 02:52 PM
How do I change from upper case to proper case in excel 2002 CT Man[_2_] Excel Discussion (Misc queries) 8 January 8th 08 06:14 PM
excel'03 how to convert a column from upper case to proper case sharie palmer Excel Discussion (Misc queries) 1 January 30th 06 11:50 PM
Excel: How do I change all upper case ss to proper case? Moosieb Excel Worksheet Functions 3 January 13th 06 12:45 AM
Changing Upper case to Proper Case Mountain Excel Worksheet Functions 1 January 13th 05 10:37 PM


All times are GMT +1. The time now is 01:42 PM.

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"