|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Private Sub CommandButton1_Click()
If Me.ListBox1.Value <> "" And Me.ListBox2.Value <> "" And (Me.TextBox1 > 0 Or Me.TextBox2 > 0) Then
Me.ListBox3.AddItem
Me.ListBox3.ColumnCount = 19
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 0) = Me.ListBox1.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 1) = Me.ListBox2.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 2) = Me.TextBox1.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 3) = Me.TextBox2.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 4) = Me.TextBox3.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 5) = Me.TextBox4.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 6) = Me.TextBox5.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 7) = Me.TextBox6.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 8) = Me.TextBox7.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 9) = Me.TextBox8.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 10) = Me.TextBox9.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 11) = Me.TextBox10.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 12) = Me.TextBox11.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 13) = Me.TextBox12.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 14) = Me.TextBox13.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 15) = Me.TextBox14.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 16) = Me.TextBox15.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 17) = Me.TextBox16.Value
Me.ListBox3.List(Me.ListBox3.ListCount - 1, 18) = Me.TextBox17.Value
Else
MsgBox "请正确输入数据"
End If
End Sub
运行出错,到橙色那行,提示运行时错误"380":无法设置list属性。无效属性值。请大神看看,谢谢指教
|
|