|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Address = "$C$2" 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
- Sheet1.Range("a4").Resize(10000, 20) = ""
- Sheet1.Range("a4").Resize(m, UBound(arr, 2)) = brr
- End If
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|