'模糊查询代码
Dim i As Long
Dim j As Long
Me.品名查询.MultiSelect = fmMultiSelectMulti
For i = 0 To Me.品名查询.ListCount - 1
Me.品名查询.Selected(i) = False
For j = 0 To Me.品名查询.ColumnCount - 1
If Me.品名查询.Column(j, i) Like "*" & Me.TextBox1.Text & "*" Then
Me.品名查询.Selected(i) = True
Exit For
End If
Next
Next
'提取的代码 提取出的内容会放在一个新工作表中
Dim i As Long
Dim j As Long
Dim k As Long
Dim sht As Worksheet
For i = 0 To Me.品名查询.ListCount - 1
If Me.品名查询.Selected(i) Then j = j + 1
Next
If j = 0 Then MsgBox "没有选中行": Exit Sub
Set sht = ThisWorkbook.Worksheets.Add
k = 1
For i = 0 To Me.品名查询.ListCount - 1
For j = 0 To Me.品名查询.ColumnCount - 1
If Me.品名查询.Selected(i) Then sht.Cells(k, j + 1) = Me.品名查询.Column(j, i)
Next
k = k + 1
Next
在其弹出的窗口中输入
Private Sub TextBox1_Change()
TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)+Val(TextBox3.Text)
End Sub
你这不是有了吗?