|
楼主 |
发表于 2024-10-6 14:15
|
显示全部楼层
本帖最后由 icenotcool 于 2024-10-6 16:39 编辑
Qs18老师,我用你的修改了一下表名,但是没有反应,可以帮忙看看怎么回事吗?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Sheet1.[c2] Then
Dim arr, i
arr = Sheet3.Range("a1").CurrentRegion
ReDim brr(1 To UBound(arr), 1 To UBound(arr, 2))
s = Sheet1.[c2].Value
For i = 2 To UBound(arr)
If s = arr(i, 10) Then
m = m + 1
For c = 2 To UBound(arr, 2)
brr(m, c) = arr(i, c)
Next
brr(m, 1) = m
End If
Next
Sheet4.Range("a2").Resize(10000, 20) = ""
Sheet4.Range("a2").Resize(m, UBound(arr, 2)) = brr
End If
End Sub
End Sub |
|