vantuqvna
Thành viên mới

- Tham gia
- 2/9/13
- Bài viết
- 6
- Được thích
- 0
Mã:
Sub q1()
Sheets("DANHMUC").Select
n = Range("B5:G504").Value
Sheets("NHAP").Select
For i = 3 To 72
If Application.WorksheetFunction.VLookup(Cells(i, 2), n, 3, 0) = False Then Cells(i, 3) = 0
Else
Cells(i, 3) = Application.WorksheetFunction.VLookup(Cells(i, 2), n, 3, 0)
End If
If Application.WorksheetFunction.VLookup(Cells(i, 2), n, 5, 0) = False Then Cells(i, 6) = 0
Else
Cells(i, 6) = Application.WorksheetFunction.VLookup(Cells(i, 2), n, 5, 0)
End If
If Application.WorksheetFunction.VLookup(Cells(i, 2), n, 6, 0) = False Then Cells(i, 7) = 0
Else
Cells(i, 7) = Application.WorksheetFunction.VLookup(Cells(i, 2), n, 6, 0)
End If
Next
End Sub
chào các anh chị trên GPE,
mình bị lỗi else without if,
Nhờ sửa giùm với ạ.
Lần chỉnh sửa cuối: