Thì tạo thêm 1 Form nữa, đưa Name DanhSachKH vào RowSource của ListBox trong Form mới, Coppy code trong Form cũ qua Form mới, sửa lại code sự kiện để đưa mã Khách hàng vào cột E:Vừa qua mình có xem file GpEb rất hay, mình xin các bạn hãy thêm vào listbox vùng chọn mới theo file mình gởi lên
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Range("D3:D65535"), Target) Is Nothing Then
FORM.Show: Cancel = True
ElseIf Not Intersect(Range("E3:E65535"), Target) Is Nothing Then
UserForm1.Show: Cancel = True
End If
End Sub
Thì tạo thêm 1 Form nữa, đưa Name DanhSachKH vào RowSource của ListBox trong Form mới, Coppy code trong Form cũ qua Form mới, sửa lại code sự kiện để đưa mã Khách hàng vào cột E:
Mã:Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If Not Intersect(Range("D3:D65535"), Target) Is Nothing Then FORM.Show: Cancel = True ElseIf Not Intersect(Range("E3:E65535"), Target) Is Nothing Then UserForm1.Show: Cancel = True End If End Sub