vba代码出错,显示用户定义类型未定义 该如何修改语句??

2024-12-26 10:29:31
推荐回答(2个)
回答1:

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
ActiveCell.Value = ListBox1.Value
Me.ListBoxl.Clear
Me.TextBoxl = ""
Me.ListBoxl.Visible = False
Me.TextBoxl.Visible = False
End Sub

改成
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
ActiveCell.Value = ListBox1.Value
Me.ListBox1.Clear
Me.TextBox1= ""
Me.ListBox1.Visible = False
Me.TextBox1.Visible = False
End Sub

回答2:

这儿出错:
Me.ListBoxl.Clear
Me.TextBoxl = ""
Me.ListBoxl.Visible = False
Me.TextBoxl.Visible = False
你把textbox1输成textboxl
本来是数字1,你输入成字母l,肯定出错