[table="width: 500"]
[tr]
[td]Function CommonStart(ByVal V As Variant) As String
Dim X As Long, L As Long, Letter As String
If VarType(V) = vbString Then
V = Split(V, ",")
ElseIf TypeOf V Is Range Then
If V.Rows.Count > 1 And V.Columns.Count > 1 Then
Exit Function
ElseIf V.Rows.Count > 1 Then
V = Application.Transpose(V)
ElseIf V.Columns.Count > 1 Then
V = Application.Index(V.Value, 1, 0)
Else
Exit Function
End If
ElseIf Not IsArray(V) Then
Exit Function
End If
If UBound(V) Then
Do
L = L + 1
Letter = Mid(V(LBound(V)), L, 1)
For X = LBound(V) To UBound(V)
If Mid(V(X) & X, L, 1) <> Letter Then
If Len(Letter) Then
CommonStart = RTrim(Left(V(LBound(V)), InStrRev(Left(V(LBound(V)), L), " ")))
Else
CommonStart = V(LBound(V))
End If
Exit Function
End If
Next
Loop While Len(Letter)
Else
CommonStart = Left(V(0), InStrRev(V(0), " ") - 1)
End If
End Function[/td]
[/tr]
[/table]