How do i make every first letter caps?

N

Nicole

Im typing business names and want to know if there is a way to automaticly
make every first letter in caps
 
D

David McRitchie

Hi Nicole,
See http://www.mvps.org/dmcritchie/excel/proper.htm
You would install both proper_case and proper_case_inner macros.
The reason for one macro invoking the other is to reduce the need for duplicate code.

You can customize how some names are to be capitalized such as
McRitchie, de Bruin, von Allen

I would not advise doing this automatically with an Event macro, because you will
always have exceptions, and watching things change after you hit enter can be a wee
bit frustrating. As far as while you type without entering that is not possible in Excel.
 
G

Gord Dibben

Nicole

Automatically would require VBA code.

Do you want that?

Example................

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column > 8 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = Application.Proper(Target.Formula)
ErrHandler:
Application.EnableEvents = True
End Sub

This is worksheet event code.

Right-click on the sheet tab and "View Code"

Copy the above code into that module.

As written it operates on the first 8 columns of the sheet.


Gord Dibben Excel MVP
 
M

Michael

Hi Nicole. Assuming you type your business names in Column A, say starting
with independent construction in A2, you could type in B2: =Proper(A2) and
it will convert A2 to Independent Construction. Copy B2 down as far as
needed and then Copy, Paste Special, Values. You could then delete column A.
HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top