|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
你所理解的 [F1].CurrentRegion区域有误,在这里它和 [A1].CurrentRegion是等价的:
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Address <> "$BV$1" Then Exit Sub
- Dim Arr, i%
-
- Arr = [F1].CurrentRegion.Offset(1)
- i = Application.Match(Target, [A1:N1], 0)
- [BV3].Resize(UBound(Arr)) = Application.Index(Arr, , 6)
- [BW3].Resize(UBound(Arr)) = Application.Index(Arr, , i)
- Range("BV2", [BV65536].End(3)(1, 2)).Sort key1:=[BW2], order1:=2, header:=xlGuess
- [BU3].Resize(UBound(Arr) - 1) = "=Row()-2"
- End Sub
复制代码 |
|