|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 jiminyanyan 于 2017-3-15 19:13 编辑
- Sub vba入门jimin()
- '扣扣:494585639
- Dim arr, d As Object, brr, crr(1 To 10000, 1 To 7), k
- Set d = CreateObject("scripting.dictionary")
- arr = Sheet2.Range("a1:f" & Sheet2.Range("a65535").End(xlUp).Row)
- For i = 2 To UBound(arr)
- d("|" & arr(i, 2)) = ""
- Next
- brr = Sheet1.Range("a1:g" & Sheet1.Range("a65535").End(xlUp).Row)
- For i = 2 To UBound(brr)
- If Not d.exists("|" & brr(i, 4)) Then
- k = k + 1
- For j = 1 To 7
- crr(k, j) = brr(i, j)
- Next
- End If
- Next
- Sheet3.Range("a2:g10000").ClearContents
- Sheet3.Range("a2").Resize(UBound(crr), UBound(crr, 2)) = crr
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|