I have list of product names that I would like to extract the last numbers from. I have macro currently that does it for me, but the problem is the user has to enable macros for it to work. I am looking for a formula to take the place of this macro:
Function LastNum(s As String) As Long
Static RX As Object
If RX Is Nothing Then
Set RX = CreateObject("VBScript.RegExp")
RX.Global = True
End If
RX.Pattern = "[\d,]+(?=\D*$)"
LastNum = RX.Execute(s)(0)
End Function
Attached is the workbook, thank you!
Bookmarks