Đưa Hàm Index/Match vào Vba của Excel | Happy Together
slide 1 slide 2 slide 3
quảng cáo sản phẩm

14/6/16

Đưa Hàm Index/Match vào Vba của Excel

Làm thế nào để đưa hàm index và hàm match chuyên tìm kiếm thông tin như dưới đây vào trong vba của Excel =INDEX(Data!B:F,MATCH(B4,Data!B:B,0),5)


Dưới đây là code cần thiết để làm điều đó.

Sub Dienthoai()

Dim i As Integer
Dim LastRow1 As Long
LastRow1 = Worksheets("Free 50k").Cells(4, "B").End(xlDown).Row

Application.Interactive = False
Application.EnableEvents = False
Application.ScreenUpdating = False
For i = 4 To LastRow1


'Cells(i, 11).Value = "=INDEX(Data!B:F,MATCH(B4,Data!B:B,0),5)"


Cells(i, 11).Value = Application.Index(Worksheets("data").Range("B:F"), Application.Match(Range("B" & i), Worksheets("data").Range("B:B"), 0), 5)


Next i


Application.Interactive = True
Application.EnableEvents = True
Application.ScreenUpdating = True

End Sub

Hãy Để Lại Nhận Xét Của Bạn

1 nhận xét:

  1. UP file đi admin ơi, đọc bài mà làm theo không được.

    Trả lờiXóa

Whatsapp Button works on Mobile Device only