Banner

Saturday, June 24, 2017

Vlookup Multiple Col_Index_Num InVBA Userform Excel





Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = "name"
End Sub

Private Sub ComboBox1_Change()
Dim i As Long
i = Application.WorksheetFunction.CountA(Sheet1.Range("A:A"))
For a = 1 To 4
Me("Textbox" & a).Value = Application.WorksheetFunction.VLookup(Me.ComboBox1.Value, _
Sheet1.Range("A" & 2, "E" & i), a + 1, 0)
Next a
End Sub

2 comments:

  1. i got error from this code

    Me("Textbox" & a).Value = Application.WorksheetFunction.VLookup(Me.ComboBox1.Value, _
    Sheet1.Range("A" & 2, "E" & i), a + 1, 0)

    can you help me.. thanks

    ReplyDelete
  2. Sir, how to code if the search is by Date not by customer

    ReplyDelete

Please do not enter any spam message in comment box