Hi Dutchie,
Never seen or heard of that convention before.
Placement is essential this is done after changing to proper.
If Left(cell.Value, 8) = "Van Der " Then cell.Value = _
"van der " & Mid(cell.Value, 9, 99)
Visual Basic is case sensitive and since I did not convert
the argument to UCASE or LCASE for the comjparison, then the
order of begin checked becomes important as well.
If Left(cell.Value, 8) = "Van Den " Then cell.Value = _
"van den " & Mid(cell.Value, 9, 99)
If Left(cell.Value, 8) = "Van Der " Then cell.Value = _
"van der " & Mid(cell.Value, 9, 99)
'-- single parts after those with two part prefixes
If Left(cell.Value, 3) = "Vd " Then cell.Value = _
"vd " & Mid(cell.Value, 4, 99)
If Left(cell.Value, 4) = "V/D " Then cell.Value = _
"v/d " & Mid(cell.Value, 5, 99)
If Left(cell.Value, 4) = "V.D " Then cell.Value = _
"v.d " & Mid(cell.Value, 5, 99)
If Left(cell.Value, 3) = "De " Then cell.Value = _
"de " & Mid(cell.Value, 4, 99)
If Left(cell.Value, 4) = "Van " Then cell.Value = _
"van " & Mid(cell.Value, 5, 99)
If Left(cell.Value, 4) = "Von " Then cell.Value = _
"von " & Mid(cell.Value, 5, 99)
Next
I have made the above changes to both
http://www.mvps.org/dmcritchie/excel/proper.htm
http://www.mvps.org/dmcritchie/excel/code/proper.txt
In American phone books (phone company) the entire last
name is captalized so it doesn't tell me much. Didn't find any "Van Den"
but did find "Van De" oops I meant "van den" and "van de" unless
"van de" isn't Dutch. Also a lot of names slip a space in out so I don't
know how you would handle vanderhoef, vanderhoff, vanderhoof
That's why I say know your data.
I converted my former company's phone book from a list of all capitals to
proper named and manually fixed twenty or additional exceptions that
were not programmed for (in REXX not in Excel) because they were ambiguous and
the result was I had to put the entire last name in capitals everything
I notice some errors in lengths in the macro on the proper.htm web page, and may
differ from code/proper.txt
-
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm