AW: Telefonnummern zusammenziehen
01.03.2005 11:04:33
UweD
Hallo
ich hab mir mal eine Benutzerfunktiun geschrieben um eine Normierung von den unterschiedlichsten Telefonnummern vorzunehmen.
|
|
| A | B | 1 | 0049 0212 690 240 | +49212690240 | 2 | +49212690-240 | +49212690240 | 3 | (0049) (0212) 690240 | +49212690240 | 4 | 0212 690240 | +49212690240 | 5 | (0212) 690-240 | +49212690240 | 6 | 0049 0212 690/240 | +49212690240 | 7 | | | 8 | | | 9 | | 49 = Ländercode für Deutschland | |
|
Dazu in ein Modul diesen Code kopieren
Function Telefon(Nr$, Code$)
Nr = Application.Substitute(Nr, " ", "")
Nr = Application.Substitute(Nr, "-", "")
Nr = Application.Substitute(Nr, "/", "")
If Left(Nr, 2) = "(0" Then
Nr = Application.Substitute(Nr, "(", "")
End If
Nr = Application.Substitute(Nr, "(0", "")
Nr = Application.Substitute(Nr, "(", "")
Nr = Application.Substitute(Nr, ")", "")
Nr = Application.Substitute(Nr, "+" & Code & "0", "+" & Code)
Nr = Application.Substitute(Nr, "00" & Code, "+" & Code)
Nr = Application.Substitute(Nr, Code & "0", Code)
If Left(Nr, 1) = "0" Then
Nr = "+" & Code & Right(Nr, Len(Nr) - 1)
End If
Telefon = Nr
End Function
Gruß UweD