I would like to extract a code from a larger extract of text, the constants I have is the Code will either start with WP or MD and end in a Numeric value and example of the patterns the code can be in are below;
WP0053
WP053
WP_053
WP_0053
WP 053
WP 0053
MDC_308
WP6
WP6.1
MDC_0308
Please see image of expected output below;
Any help would be much appreciated
Public Function GetCode(data As String) As String
End Function
Add this Code in any Module and try.