SHARE
TWEET

Untitled

a guest Sep 19th, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Function simpleCellRegex(Myrange As Range) As String
  2.     Dim regEx As New RegExp
  3.     Dim strPattern As String
  4.     Dim strInput As String
  5.     Dim strReplace As String
  6.     Dim strOutput As String
  7.  
  8.  
  9.     strPattern = "<a\b([^>""']|""[^""]*""|'[^']*')+\bclass=""changed-by"">.*?<\/a>"
  10.  
  11.     If strPattern <> "" Then
  12.         strInput = Myrange.Value
  13.         strReplace = ""
  14.  
  15.         With regEx
  16.             .Global = True
  17.             .MultiLine = True
  18.             .IgnoreCase = False
  19.             .Pattern = strPattern
  20.         End With
  21.  
  22.         If regEx.Test(strInput) Then
  23.             simpleCellRegex = regEx.Replace(strInput, strReplace)
  24.         Else
  25.             simpleCellRegex = "Not matched"
  26.         End If
  27.     End If
  28. End Function
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top