|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
黑仔 发表于 2013-11-26 18:15
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem) 这个才是单击事件的吧!
ListVi ...
改为ListView1_ItemClick事件,查到日期正行选择:- Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
- Dim c As Range, rngU As Range, m&, firstAddress$
- With Range("a:a")
- Set c = .Find(DateValue(Item), , xlFormulas, xlWhole) '查找日期
- If Not c Is Nothing Then
- firstAddress = c.Address
- Do
- m = m + 1
- If m = 1 Then Set rngU = c Else Set rngU = Union(rngU, c)
- Set c = .FindNext(c)
- Loop While Not c Is Nothing And c.Address <> firstAddress
- End If
- End With
- If m > 0 Then
- rngU.EntireRow.Select
- Unload Me '关闭窗体
- ' Me.Hide '或用隐藏窗体
- Else
- MsgBox "没有查到。", vbInformation
- End If
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|