|
双条件改成单条件- Sub ykcbf() '//2024.7.26
- Application.ScreenUpdating = False
- Set sh = ThisWorkbook.Sheets("Sheet0")
- st = sh.[b1].Value
- ReDim brr(1 To 10000, 1 To 9)
- For Each sht In Sheets
- If sht.Name <> sh.Name Then
- With sht
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 8)
- For i = 2 To UBound(arr)
- If arr(i, 8) = st Then
- m = m + 1
- For j = 1 To UBound(arr, 2)
- brr(m, j) = arr(i, j)
- Next
- brr(m, 9) = .Name
- End If
- Next
- End With
- End If
- Next
- With sh
- .[a5:i10000] = ""
- .[a5].Resize(m, 9) = brr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|