Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
456 views
in Technique[技术] by (71.8m points)

excel - Need help dIagnosing VBA Mismatch ERROR 13

I'm currently creating a simple form with an edit function that autofills the remainder details using the application.match function.

however based on my current code, i'm drawing error 13. (vba newbie here btw)

anyway here's the code - would appreciate the feedback (if any ). Namaste! :

Private Sub CmbBox2_inv_edit_Change()

    If Me.CmbBox2_inv_edit.Value <> "" Then
    
        Dim sh As Worksheet
        Set sh = ThisWorkbook.Sheets("Data Input Form")
        
        Dim i As Integer
        
        i = Application.Match(VBA.CLng(Me.CmbBox2_inv_edit.Value), sh.Range("A:A"), 0)
        
        
        Me.TextBox2_DATE.Value = sh.Range("B" & i).Value
        Me.txtbox3_name.Value = sh.Range("C" & i).Value
        Me.CmbBox1.Value = sh.Range("D" & i).Value
        Me.TextBox4_sales_amnt.Value = sh.Range("E" & i).Value
        
    End If
                   
End Sub
question from:https://stackoverflow.com/questions/65661234/need-help-diagnosing-vba-mismatch-error-13

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...