AW: Formate Telefonnummern
02.03.2006 14:08:11
UweD
Hallo
hab ich mir mal programmiert:
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
in ein Modul copieren..
In der Tabelle wird das dann so verwendet...
|
|
| A | B | 1 | Beispiele | | 2 | 0049 0212 690 240 | +49212690240 | 3 | +49212690-240 | +49212690240 | 4 | (0049) (0212) 690240 | +49212690240 | 5 | 0212 690240 | +49212690240 | 6 | (0212) 690-240 | +49212690240 | |
|
Gruß UweD
(Rückmeldung wäre schön)