Sub ykcbf() '//2023.3.3
Dim arr, brr(1 To 60000, 1 To 10)
Set sh = Sheets("Sheet0")
With sh
st1 = .[f1]
st2 = .[h1]
End With
For Each SHt In Sheets
If SHt.Name <> sh.Name Then
arr = SHt.[a1:i50000]
For i = 1 To UBound(arr)
If arr(i, 6) = st1 And arr(i, 8) = st2 Then
m = m + 1
brr(m, 10) = SHt.Name & "表第" & i & "行"
For j = 1 To UBound(arr, 2)
brr(m, j) = arr(i, j)
Next
End If
Next
End If
Next
With sh
.[a15:z60000] = ""
.[a15].Resize(m, 10) = brr
For i = 1 To m
ActiveSheet.Hyperlinks.Add anchor:=sh.Cells(i + 14, 10), Address:="", SubAddress:="'" & Split(brr(i, 10), "表")(0) & "'!a" & Replace(Split(brr(i, 10), "第")(UBound(Split(brr(i, 10), "第"))), "行", ""), TextToDisplay:=brr(i, 10)
Next
End With
End Sub
|