• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Vlookup and Match fuction in userform show error

delta

Member
what is wrong in code

>>> use code - tags <<<
Code:
Private Sub CommandButton1_Click()
Me.TextBox1.Value = Application.WorksheetFunction.VLookup(Me.ComboBox1.Value, Sheet2.Range("A2:A8"), Application.WorksheetFunction.Match(Me.ComboBox2.Value, Sheet2.Range("B1:E1"), 0), 0)
End Sub

I attach the sample file
 

Attachments

  • V_Look_Up_And_Match_UserForm .xlsm
    23.4 KB · Views: 7
Last edited by a moderator:
delta
Why did You duplicate Your thread?
You could add more details to Your original ...
Your original thread is closed now!
 
Code:
Me.TextBox1.Value = Application.WorksheetFunction.VLookup(Me.ComboBox1.Value, Sheet2.Range("A2:E8"), Application.WorksheetFunction.Match(Me.ComboBox2.Value, Sheet2.Range("A1:E1"), 0), 0)
or shorter:
Code:
TextBox1.Value = Application.VLookup(ComboBox1.Value, Sheet2.Range("A2:E8"), Application.Match(ComboBox2.Value, Sheet2.Range("A1:E1"), 0), 0)
 
Back
Top