My code:

```
Public Sub splitUpRegexPattern()
Dim regEx As New RegExp
Dim strPattern As String
Dim strInput As String
Dim strReplace As String
Dim Myrange As Range

Set Myrange = ActiveSheet.Range("B2:B4279")

For Each c In Myrange
    strPattern = "([A-Z]{2}\/[A-Z]{2}\/[A-Z][0-9]{2}\/[a-z]{3}[0-9]{9}\/)([0-9]{4})"

    If strPattern <> "" Then
        strInput = c.Value
        strReplace = "$1"

        With regEx
            .Global = True
            .MultiLine = True
            .IgnoreCase = False
            .Pattern = strPattern
        End With

        If regEx.test(strInput) Then
            c.Offset(0, 1) = regEx.Replace(strInput, "$2")
        Else
            c.Offset(0, 1) = ""
        End If
    End If
Next

```

End Sub

It was initially working well, it would give me an error, but still complete the task it was doing. But when I use this macro on a new spreadsheet, it gives me the error:

`Compile Error: Method or Data Member not found.`

All the solutions on this site are tailored to different situations, so I couldn't apply them to my circumstance unfortunately.

I have no idea why this is happening, as I haven't changed any of the code. I am sure if I had a greater understanding with VBA script that I would be able to understand this, but I do not, so I came to find out if someone here could help me!

Thanks!

Aydan