Em có lập 1 sử dụng vba như file đính kèm để lấy số liệu từ sheet1 sang sheet2 cho nhanh. Nhưng phải làm như thế nào để khi tìm số liệu trong cột A trong sheet1 không có thì sẽ hiện bảng thông báo " số liệu này không có". Như file đính kèm. Mong a e giúp.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim dl As Worksheet, ma
ScreenUpdating = False
Set dl = Sheets("sheet1")
If Target.Column = 2 Then
If Target.Text <> "" Then
Set ma = dl.[a:a].Find(Target.Value, , , xlWhole)
If Not ma Is Nothing Then
dl.Range(dl.Cells(ma.Row, 1), dl.Cells(ma.Row, 2)).Copy Cells(Target.Row, 2)
dl.Cells(ma.Row, 1).Offset(, 3).Copy Cells(Target.Row, 4)
[COLOR=#ff0000] Else
MsgBox " so nay ko co"[/COLOR]
End If
End If
End If
ScreenUpdating = True
End Sub