Try this, it might not work in all circumstances and there's probably a more elegant way to do it, but it works for your examples:
Public Function ExtractMac(rng As Range) As String
Dim intL As Integer
Dim vars
vars = Split(UCase(Replace(rng.Value, " ", "")), "X")
For intL = LBound(vars) To UBound(vars)
On Error Resume Next
If (CInt(Right(vars(intL), 3)) And CInt(Left(vars(intL + 1), 3))) Then
ExtractMac = CInt(Right(vars(intL), 3)) & "x" & CInt(Left(vars(intL + 1), 3))
End If
Next intL
End Function
@thb to use this right click on a sheet tab > view code.
In the VBE, right click in the project window - on the left where your sheets are listed, insert > module
Paste the above in the blank page it gives you.
You can then use it as a normal function ie. =ExtractMac(A1)
Bookmarks