|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
地主上传的文件为啥扩展名是不对的
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Address = [G1].Address Then Call WjW(Target.Value)
- End Sub
- Sub WjW(St$)
- Dim Arr, Brr, i&, j&, Dic As Object, Dk
- Dim R As Range
- Arr = [A1].CurrentRegion
- ReDim Brr(1 To UBound(Arr), 1 To 4)
- Set Dic = CreateObject("Scripting.Dictionary")
- For i = 2 To UBound(Arr)
- If Arr(i, 3) = St Then
- Dic(Split(Arr(i, 2), ".")(0)) = ""
- End If
- Next i
- For i = 2 To UBound(Arr)
- If Dic.Exists(Split(Arr(i, 2), ".")(0)) Then
- j = j + 1
- Brr(j, 1) = Arr(i, 1)
- Brr(j, 2) = St
- Brr(j, 3) = Arr(i, 2)
- Brr(j, 4) = Arr(i, 3)
- End If
- Next i
- [F5].Resize(UBound(Brr), 4) = Brr
- Set Dic = Nothing
- End Sub
复制代码 |
|