|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub 查找()
- Dim vData As Variant, nRow As Integer
- Dim wSH As Worksheet, dicSheet As Object
- Dim vFill As Variant, sDate As String
-
- sDate = Format(Now(), "YYYYMMDD")
- Set dicSheet = CreateObject("Scripting.Dictionary")
- With Sheets("首页")
- nRow = .Cells(.Rows.Count, 3).End(xlUp).Row
- vData = .[C7].Resize(nRow - 6).Value
- For nRow = 1 To UBound(vData)
- dicSheet("Sheet" & Trim(vData(nRow, 1))) = nRow
- Next
- ReDim vFill(1 To UBound(vData), 1 To 1)
- For Each wSH In Sheets
- If wSH.Name <> .Name Then
- With wSH
- nRow = .Cells(.Rows.Count, 13).End(xlUp).Row
- vData = .[M1].Resize(nRow).Value
- For nRow = 1 To UBound(vData)
- If bExists = Format(vData(nRow, 1), "YYYYMMDD") = sDate And dicSheet.Exists(.Name) Then
- vFill(dicSheet(.Name), 1) = "有"
- Exit For
- End If
- Next
- End With
- End If
- Next
- .[K7].Resize(UBound(vFill)) = vFill
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|