- 帖子
- 967
- 主題
- 0
- 精華
- 0
- 積分
- 1001
- 點名
- 0
- 作業系統
- WIN XP
- 軟體版本
- OFFICE 2003
- 閱讀權限
- 50
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-11-29
- 最後登錄
- 2022-5-17
 
|
2#
發表於 2012-3-9 14:36
| 只看該作者
回復 1# fusayloveme - Sub xx()
- Sheets("A資料庫").Select
- Set SourceA = Sheets("A資料庫").Range([A2], [A65536].End(xlUp))
- Sheets("B資料庫").Select
- Set SourceB = Sheets("B資料庫").Range([A2], [A65536].End(xlUp))
- For Each A In SourceA
- X = Application.CountIf(SourceB, A) - Application.CountIf(SourceA, A)
- If X <> 0 Then
- Set RFind = Columns("E").Find(A, , , xlWhole)
- If RFind Is Nothing Then
- [E65536].End(xlUp).Offset(1, 0) = A
- [E65536].End(xlUp).Offset(0, 1) = X
- End If
- End If
- Next A
- For Each B In SourceB
- X = Application.CountIf(SourceB, B) - Application.CountIf(SourceA, B)
- If X <> 0 Then
- Set RFind = Columns("E").Find(B, , , xlWhole)
- If RFind Is Nothing Then
- [E65536].End(xlUp).Offset(1, 0) = B
- [E65536].End(xlUp).Offset(0, 1) = X
- End If
- End If
- Next B
- End Sub
複製代碼
|
|