- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
- Sub ex()
- Set d = CreateObject("Scripting.Dictionary")
- With 工作表1
- For Each a In .Range(.[A1], .[A1].End(xlDown))
- mystr = a & a.Offset(, 1) & a.Offset(, 2) & a.Offset(, 4)
- If d.exists(mystr) Then MsgBox a & "資料重複"
- d(mystr) = Application.Transpose(Application.Transpose(a.Resize(, 6).Value))
- Next
- End With
- With 工作表2
- .Cells.ClearContents
- .[A1].Resize(d.Count, 6) = Application.Transpose(Application.Transpose(d.items))
- End With
- End Sub
複製代碼 回復 5# jackyliu |
|