Fro your attached data
=StrArrange(B9)

Function StrArrange(ByVal txt As String) As String
    With CreateObject("VBScript.RegExp")
        .Pattern = "^(.+?)( .*?-\S+)?( .+)( M\d+)$"
        If .test(txt) Then txt = .Replace(txt, "$1$4$3$2")
    End With
    StrArrange = txt
End Function