ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Proper case (https://www.excelbanter.com/excel-programming/274837-re-proper-case.html)

Chip Pearson

Proper case
 
Arne,

Try something like the following:

Sub AAA()
Dim Rng As Range
For Each Rng In Selection.Cells
If StrComp(Rng.Text, StrConv(Rng.Text, vbProperCase), _
vbBinaryCompare) < 0 Then
Rng(1, 2).Value = "x"
Rng.Value = StrConv(Rng.Text, vbProperCase)
End If
Next Rng
End Sub

Select the cells to test an then execute the procedure.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"arne" wrote in message
...
In column D ther are names and they must be in Proper Cae. I

want to loop
through these and
1. Set and x in a new column x if the name is not proper case
2. Then set propercase for these

Ex:
start
teD
DANA

Res
Ted x
Dana x







All times are GMT +1. The time now is 09:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com