Match TextBox Value with Range value

  • sheet2 range A2:A10 contains name and in
    userform TextBox1 and command Button
    i issue is when i click on command button in userform if TextBox name is match with sheet2 range A2:A10 then message box show Exits name else message box show Do not exits name
    how to done by vba in excel userform

  • try this:

    On Error Resume Next
      If IsEmpty(Application.WorksheetFunction.Match(TextBox1, Range("a10:a13"), 0)) Then x = MsgBox("No Match") Else x = MsgBox("Match")
    On Error GoTo 0

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!