Function Break_name(noi_dung As String) As String Break_name = Mid(noi_dung, InStrRev(" " & Replace(noi_dung, "B/O:", " BO:"), "BO:", , 1) + 1) Break_name = Left(Break_name, InStr(1, Break_name & "thanh toan", "thanh toan", 1) - 1) End Function
Cám ơn cao nhân đã chỉ giáo.
Mong cao nhân giúp thêm đoạn dưới đây ạ
////
Function Break_name(noi_dung As String) As String
Break_name = Mid(noi_dung, InStrRev(" " & Replace(noi_dung, "CONG TY", "Cty"), "Cty", , 1) - 2)
On Error Resume Next
Break_name = Mid(noi_dung, InStrRev(" " & Replace(noi_dung, "CTCP", "Cty"), "Cty", , 1) - 2)
On Error Resume Next
Break_name = Mid(noi_dung, InStrRev(" " & Replace(noi_dung, "_CT", "Cty"), "Cty", , 1) - 2)
On Error Resume Next
Break_name = Mid(noi_dung, InStrRev(" " & Replace(noi_dung, "CT ", "Cty"), "Cty", , 1) - 2)
Break_name = Left(Break_name, InStr(1, Break_name & "thanh toan", "thanh toan", 1) - 1)
On Error Resume Next
Break_name = Left(Break_name, InStr(1, Break_name & "MST:", "MST:", 1) - 1)
On Error Resume Next
Break_name = Left(Break_name, InStr(1, Break_name & "TT", "TT", 1) - 1)
On Error Resume Next
Break_name = Left(Break_name, InStr(1, Break_name & "T/Toan", "T/toan", 1) - 1)
On Error Resume Next
Break_name = Left(Break_name, InStr(1, Break_name & "chuyen tien", "chuyen tien", 1) - 2)
End Function
////