|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub 对照借贷款()
- Set a = ActiveSheet
- Set d_borrow = CreateObject("scripting.dictionary")
- Set d_loan = CreateObject("scripting.dictionary")
- x = Range("e65536").End(xlUp).Rows
- y = a.UsedRange.Columns.Count
- For i = 1 To x
- d_borrow(i) = a.Cells(i, 1).Value & "_" & Val(a.Cells(i, 4).Value) & "_" & Val(a.Cells(i, 5).Value)
- d_loan(i) = a.Cells(i, 10).Value & "_" & Val(a.Cells(i, 11).Value) & "_" & Val(a.Cells(i, 12).Value)
- Next
- For Each i In d_borrow.keys
-
- For Each ii In d_loan.keys
-
- If d_borrow(i) = d_loan(ii) Then
- a.Cells(i, 1).Value = ""
- a.Cells(ii, 10).Value = ""
- Exit For
- End If
- Next
- Next
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|