View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
andreashermle andreashermle is offline
external usenet poster
 
Posts: 123
Default Extracting names and titles

On Nov 26, 6:24*pm, "Peter T" <peter_t@discussions wrote:
Sub test()
Dim i As Long
Dim s As String
Dim sArr() As String
* * s = "Dr. med. Betty Eastwood"
* * sArr = Split(s, " ")
* * If UBound(sArr) = 0 Then
* * * * For i = 0 To UBound(sArr)
* * * * * * Debug.Print sArr(i)
* * * * Next
* * End If
End Sub

Regards,
Peter T

"andreashermle" wrote in message

...



Dear Experts:


I got a client list (German names) where the whole name including
title is in just one cell, such as


Dr. med. Betty Eastwood
Prof. Dr. Dr. Joe Doe
Dr. John Westwood
Dr. phil. Robert Friedman


I know how to extract the first occurrence of a word and the last one,
i.e. in the first example "Dr." and "Eastwood". But how to extract the
ones that are in between (one to three occurrences).


Help is much appreciated. Thank you very much in advance.


Regards, Andreas- Hide quoted text -


- Show quoted text -


Hi Peter,

thank you very much for your swift answer. I am afraid to tell you
that the macro is not working. Any idea why.

Regards, Andreas