Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically capitalize the first letter of each word.

Status
Not open for further replies.

maxedison9

Instructor
Nov 16, 2007
2
VE
I'm preparing a list of addresses. Is there a way to automatically format all the text in a Microsoft Word or Excel document so that the first letter of every word is capitalized and the rest are lower case?
 
Format | Change Case... | title case

If you have stuff that is all caps, you would need to change to lower case first.
 
I have figured out how to do this simply using the "Change Case" button, but it also forces all letters but the first one to be lower case. This is problematic since the state needs to be in caps (i.e. NY, MA, etc.).
 
I think you should break it down to individual columns. It will make the formatting easier. Here is one very inefficient way to do it all with excel formulas:

ORIGINAL INFO
new york, ny 00000
new york city,ny 000001234

FORMULAS FOR ADDRESS IN CELL A1
(first line city, second state, third zip)
=PROPER(TRIM(LEFT(A1,SEARCH(",",A16)-1)))
=UPPER(TRIM(MID(A1,SEARCH(",",A16)+1,3)))
=TRIM(RIGHT(A1,SEARCH(",",A16)-4))

MODIFIED ADDRESSES
New York NY 00000
New York City NY 000001234


[blue]When birds fly in the correct formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness.[/blue]
 
Here's the quick and dirty in Word ..
Code:
[blue]    With ActiveDocument.Content.Find
        .MatchWildcards = True
        .Text = "<[a-z]"
        .Replacement.Font.AllCaps = True
        .Execute Replace:=wdReplaceAll
    End With
[/blue]

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
In excel, you can use PROPER(a2) and this give you proer case i.e. the first letter is upper case and the rest is lower case.

Fee

The question should be [red]Is it worth trying to do?[/red] not [blue] Can it be done?[/blue]
 
maxedison9 said:
format all the text .. so that the first letter of every word is capitalized and the rest are lower case

Not sure why PROPER doesn't answer the OP?

Fee

The question should be [red]Is it worth trying to do?[/red] not [blue] Can it be done?[/blue]
 
It does answer the original post but not the further information in his second post that he doesn't want state abbreviations, NY for example, changed to Ny.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top