Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function NoHP(MyRange As Range)
- Dim regEx As Object
- Dim allMatches
- Set regEx = CreateObject("VBScript.RegExp")
- With regEx
- .Pattern = "([\d+]+)"
- .IgnoreCase = True
- .Global = True
- End With
- Set allMatches = regEx.Execute(MyRange)
- If allMatches.Count > 0 Then
- NoHP = allMatches(0)
- Else
- NoHP = ""
- End If
- End Function
- Function Email(MyRange As Range) As String
- Dim regEx As Object
- Dim Patternnya As String
- Dim allMatches
- Patternnya = "[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"
- Set regEx = CreateObject("VBScript.RegExp")
- With regEx
- .Pattern = Patternnya
- .IgnoreCase = True
- .Global = True
- End With
- Set allMatches = regEx.Execute(MyRange)
- If allMatches.Count > 0 Then
- Email = allMatches(0)
- Else
- Email = ""
- End If
- End Function
Add Comment
Please, Sign In to add comment