|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Private Sub cmdSave_Click()
Dim i&, j&, k&
Dim ar()
ReDim ar(1 To UBound(arr), 1 To UBound(arr, 2))
With lstBooks
.Clear
For i = 1 To UBound(arr) '多条件模糊查询,只需把各列串联起来即可。
If InStr(arr(i, 1) & "|" & arr(i, 2) & "|" & arr(i, 3), txtBookId) Then
kk = kk + 1
For j = 1 To UBound(arr, 2)
ar(kk, j) = arr(i, j)
Next j
End If
Next i
If kk <> "" Then .List = ar
End With
End Sub
Private Sub lstBooks_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
With lstBooks
txtBookId.Text = .Column(0)
txtBookName.Text = .Column(1)
txtAuthor.Text = .Column(2)
txtPrice.Text = .Column(3)
txtCBS.Text = .Column(4)
End With
End Sub
|
|