• 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.

VBA for Matching -Encounter error mismatch(16)

siddhuprince86

New Member
Code debugging Help for Mismatch
Dear Form,

supplier Form

I am New to VBA still trying to learn something New ,

i got struct in particular Code for Matching the content of details from excel
while running it has given error Mismatch , can anyone help in debugging it

The Below is the code

Private Sub ComboBox6_Change()

If Me.ComboBox6.Value <> "" Then
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Supplier master")
Dim i As Integer

i = Application.Match(VBA.CLng(Me.ComboBox6.Value), sh.Range("B:B"), 0)
Me.TextBox2.Value = sh.Range("C" & i).Value
Me.TextBox3.Value = sh.Range("D" & i).Value
Me.TextBox4.Value = sh.Range("E" & i).Value
Me.TextBox5.Value = sh.Range("F" & i).Value
Me.TextBox6.Value = sh.Range("G" & i).Value
Me.TextBox7.Value = sh.Range("H" & i).Value
Me.TextBox8.Value = sh.Range("I" & i).Value
Me.TextBox9.Value = sh.Range("J" & i).Value
Me.TextBox10.Value = sh.Range("K" & i).Value
Me.TextBox11.Value = sh.Range("L" & i).Value
Me.TextBox12.Value = sh.Range("L" & i).Value
Me.TextBox13.Value = sh.Range("L" & i).Value
Me.TextBox14.Value = sh.Range("L" & i).Value
Me.TextBox15.Value = sh.Range("M" & i).Value
Me.TextBox18.Value = sh.Range("M" & i).Value
Me.TextBox17.Value = sh.Range("M" & i).Value
Me.TextBox16.Value = sh.Range("M" & i).Value
Me.ComboBox5.Value = sh.Range("N" & i).Value
Me.TextBox19.Value = sh.Range("O" & i).Value
Me.TextBox21.Value = sh.Range("P" & i).Value
Me.TextBox22.Value = sh.Range("Q" & i).Value
Me.TextBox23.Value = sh.Range("R" & i).Value
Me.TextBox24.Value = sh.Range("S" & i).Value
Me.TextBox25.Value = sh.Range("T" & i).Value
Me.TextBox26.Value = sh.Range("U" & i).Value
End If

I have also attached the Excel sheet i am working ,
Pls look for Update form in Developer,

Private Sub ComboBox6_Change()

The code under this Banner is giving error

Pls give a solution or point out the mistake i have done

with regrads,
Siddhartha
 
Back
Top