
Function EmailAddress(ByVal sTesto As String) As String
Dim sRet As String
Dim aToken As Variant
Dim j As Long
aToken = Split(sTesto, " ")
For j = LBound(aToken) To UBound(aToken)
sRet = aToken(j)
If InStr(sRet, "@") > 0 Then
EmailAddress = sRet
Exit For
End If
Next
End Function
|
Sub EliminaEmail()
Dim rng As Range
Dim cella As Range
Dim re As Object
Dim sParsed As String
Const sPatt As String = " [A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}"
Set re = CreateObject("VBScript.RegExp")
Set rng = Selection
re.Global = True
For Each cella In rng
re.Pattern = sPatt
re.IgnoreCase = True
sParsed = re.Replace(cella.Text, "")
cella.Value = sParsed
Next
Set rng = Nothing
Set re = Nothing
End Sub
|
Per il nome:
=SINISTRA(A4;LUNGHEZZA(A4)-LUNGHEZZA(STRINGA.ESTRAI(STRINGA.ESTRAI(A4;TROVA(" ";A4;1)+1;LUNGHEZZA(A4));TROVA(" ";STRINGA.ESTRAI(A4;TROVA(" ";A4;1)+1;LUNGHEZZA(A4));1)+1;LUNGHEZZA(STRINGA.ESTRAI(A4;TROVA(" ";A4;1)+1;LUNGHEZZA(A4))))))
Per la mail:
=STRINGA.ESTRAI(STRINGA.ESTRAI(A4;TROVA(" ";A4;1)+1;LUNGHEZZA(A4));TROVA(" ";STRINGA.ESTRAI(A4;TROVA(" ";A4;1)+1;LUNGHEZZA(A4));1)+1;LUNGHEZZA(STRINGA.ESTRAI(A4;TROVA(" ";A4;1)+1;LUNGHEZZA(A4))))
|
=SINISTRA(A4;LUNGHEZZA(A4)-LUNGHEZZA(STRINGA.ESTRAI(STRINGA.ESTRAI(A4;TROVA(" ";A4;1)+1;LUNGHEZZA(A4));TROVA(" ";STRINGA.ESTRAI(A4;TROVA(" ";A4;1)+1;LUNGHEZZA(A4));1)+1;LUNGHEZZA(STRINGA.ESTRAI(A4;TROVA(" ";A4;1)+1;LUNGHEZZA(A4)))))-1) |
Sub EliminaEmail()
Dim rng As Range
Dim cella As Range
Dim re As Object
Dim sParsed As String
Const sPatt As String = " [A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}"
Set re = CreateObject("VBScript.RegExp")
Set rng = Selection
re.Global = True
re.Pattern = sPatt
re.IgnoreCase = True
For Each cella In rng
sParsed = re.Replace(cella.Text, "")
cella.Value = sParsed
Next
Set rng = Nothing
Set re = Nothing
End Sub
|
