I have a spread sheet created with Excel 2007. One colum has first and last
names in all caps. How can I convert the first letter for each name to be
caps and the rest of the letters to be lowercase? I want to do the whole
colum at once.
Thanks

Signature
----------------------------------------------------
This mailbox protected from unsolicited email by Spam Alarm
from Dignity Software http://www.dignitysoftware.com
Don Guillett - 04 May 2008 14:48 GMT
One way
Sub makeallproper()
mc = "c"
lr = Cells(Rows.Count, mc).End(xlUp).Row
Range(Cells(1, mc), Cells(lr, mc)).Value = _
Application.Proper(Range(Cells(1, mc), Cells(lr, mc)).Value)
End Sub

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
>I have a spread sheet created with Excel 2007. One colum has first and last
>names in all caps. How can I convert the first letter for each name to be
>caps and the rest of the letters to be lowercase? I want to do the whole
>colum at once.
>
> Thanks
The poster formerly known as Colleyville Alan - 04 May 2008 14:59 GMT
The worksheet function "Proper" capitalizes the first letter of each string
and makes the rest lower case. In your example, I am guessing that it
should work fine, though you need to check it closely. Sometimes the last
name has more than one part, e.g. in Ludwig van Beethoven has the "van" all
in lower case. There are likely other cases, perhaps Asian surnames (though
none come to mind) where it will give you an incorrect result; i.e. just
what you asked for but not what you need. So use it judiciously.
>I have a spread sheet created with Excel 2007. One colum has first and last
>names in all caps. How can I convert the first letter for each name to be
>caps and the rest of the letters to be lowercase? I want to do the whole
>colum at once.
>
> Thanks
Doug - 04 May 2008 15:37 GMT
Is this right?
=proper(B4:B40)

Signature
----------------------------------------------------
This mailbox protected from unsolicited email by Spam Alarm
from Dignity Software http://www.dignitysoftware.com
> The worksheet function "Proper" capitalizes the first letter of each
> string and makes the rest lower case. In your example, I am guessing that
[quoted text clipped - 11 lines]
>>
>> Thanks
Don Guillett - 04 May 2008 15:55 GMT
no

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
> Is this right?
> =proper(B4:B40)
[quoted text clipped - 14 lines]
>>>
>>> Thanks
The poster formerly known as Colleyville Alan - 04 May 2008 16:28 GMT
No. You might have in, say, cell C4 =proper(b4) then in cell C5 =proper(b5),
etc; i.e. you copy the formula to a parallel column with formulas matching
each cell.
Depending upon the application, you might want to use the VBA approach that
Don Guillett showed you, but if you simply want to quickly convert the
information using a formula in a worksheet would prove faster.
If you then want to change the results from formulas to text, perhaps to
email someone or for use in another application, you could highlight the
cells with the formulas, and then choose from the menu:
edit | copy |
followed by
edit | pastespecial | values
I do this so often that I hardly can remember the menu commands, I just
remember alt-e,c then alt-e,s,v
> Is this right?
> =proper(B4:B40)
[quoted text clipped - 14 lines]
>>>
>>> Thanks
Jan Haraldsson - 09 May 2008 03:31 GMT
Here is an other way to deal with selected cells anywhere in the worksheet..
' Force explicit variable declaration
Option Explicit
Sub PROPER()
' Variable for selected cells
Dim Cell
' Change all cells in the current selection
For Each Cell In Selection
Cell.Value = Application.WorksheetFunction.PROPER(Cell.Value)
Next
End Sub
> I have a spread sheet created with Excel 2007. One colum has first and
> last names in all caps. How can I convert the first letter for each name
> to be caps and the rest of the letters to be lowercase? I want to do the
> whole colum at once.
>
> Thanks
Gord Dibben - 09 May 2008 17:26 GMT
Just a warning here...........
If you have any formulas in your selected range, the posted code will change
those formulas to values.
Perferable is to leave them alone.
Sub Proper()
Dim Cell As Range
Application.ScreenUpdating = False
For Each Cell In Selection
Cell.Formula = Application.Proper(Cell.Formula)
Next
Application.ScreenUpdating = True
End Sub
Gord Dibben MS Excel MVP
>Here is an other way to deal with selected cells anywhere in the worksheet..
>
[quoted text clipped - 18 lines]
>>
>> Thanks
Sandy Mann - 09 May 2008 18:22 GMT
Gord,
Would this amendment get around that probelm or have I just swapped one
error for another?
Sub Proper()
Dim Cell As Range
Application.ScreenUpdating = False
For Each Cell In Selection
If Not Cell.HasFormula Then
Cell.Value = Application.Proper(Cell.Value)
End If
Next
Application.ScreenUpdating = True
End Sub
In my limited testting it seems to work.

Signature
HTH
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk
> Just a warning here...........
>
[quoted text clipped - 42 lines]
>>>
>>> Thanks
Gord Dibben - 09 May 2008 19:53 GMT
That is another routine that I have posted in the past.
Works fine for me and I have not run into any problems with it.
Gord
>Gord,
>
[quoted text clipped - 13 lines]
>
>In my limited testting it seems to work.