【发布时间】:2020-04-01 19:25:20
【问题描述】:
我在用户窗体中使用组合框来显示来自某个单元格的值,我使用 application.match 来匹配其对应的行以显示在其他文本框中
这是我的组合框代码:
Private Sub ComboBox1_Change()
If Me.ComboBox1.Value <> "" Then
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Student Profile")
Dim i As Integer
i = Application.Match(VBA.CLng(Me.ComboBox1.Value), sh.Range("A:A"), 0)
Me.TextBoxAddress.Value = sh.Range("D" & i).Value
Me.TextBoxContact.Value = sh.Range("E" & i).Value
Me.TextBoxName.Value = sh.Range("B" & i).Value
Me.TextBoxSection.Value = sh.Range("C" & i).Value '''
End If
错误提示:
运行时错误 13:类型不匹配。
似乎是什么问题?
【问题讨论】: