[QUOTE=bongmaihung;613971]
Mã:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Dim Tem, Str As String
If Target.Column = 3 And Target.Count = 1 Then
Str = Application.WorksheetFunction.Proper(Target)
Tem = Split(Trim(Str), " ")
Target.Offset(, 1).Value = Tem(UBound(Tem))
Target.Value = Trim(Left(Str, Len(Str) - Len(Target.Offset(, 1))))
End If
Application.EnableEvents = True
End Sub
Mình đổi thành Target.Offset(, 0) để nó không tách cột,mà khi viết sai xóa đi viết lại thì bị lỗi này là sao,cám ơn nhiều