|
- Sub 查询(Lvw As ListView, Firstdate As Date, Lastdate As Date, Index As String)
- Dim arr()
- Dim Item As ListItem
- Dim i As Integer
- Dim n As Byte
- Dim Hj As Long
- arr = Sheet12.Range("A2:G" & Sheet1.Range("A65536").End(xlUp).Row)
- With Lvw.ListItems
- .Clear
- For i = 1 To UBound(arr)
- If arr(i, 3) = Index And arr(i, 6) >= Firstdate And arr(i, 6) <= Lastdate Then
- Set Item = .Add()
- Item.Text = arr(i, 1)
- For n = 2 To 7
- Item.SubItems(n - 1) = arr(i, n)
- Next
- End If
- Next
- For i = 1 To .Count
- Hj = Hj + .Item(i).ListSubItems(6).Text
- Next
- Set Item = .Add()
- With Item
- .SubItems(5) = "数量合计:"
- .SubItems(6) = Hj
- .ListSubItems(5).Bold = True
- .ListSubItems(5).ForeColor = vbRed
- .ListSubItems(6).Bold = True
- .ListSubItems(6).ForeColor = vbRed
- End With
- <span style="background-color: yellow;"> QueryFrm.TextBox10.Text = Hj</span>
- End With
- End Sub
复制代码 运行到黄色部分 提示要求对象 求大神帮忙看下哪里出错了
|
|