- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 258
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-28
|
¦^´_ 1# amychlo
±Nµ{¦¡½X©ñ¦b·J¾ãªº¬¡¶Ã¯¤@¯ë¼Ò²Õ- Sub ·J¾ã()
- Set d = CreateObject("Scripting.Dictionary")
- fd = ThisWorkbook.Path & "\" '3ÓÀɮשñ¦b¦P¥Ø¿ý¤¤
- 'fd="D:\" '«ü©wA¡BB2Àɮתº¦s©ñ¥Ø¿ý
- fs = Array("A.xls", "B.xls")
- d("³W®æ") = "¼Æ¶q"
- For Each f In fs
- With Workbooks.Open(fd & f)
- With .Sheets(1)
- i = i + 1
- .UsedRange.Copy ThisWorkbook.Sheets(i).[A1]
- With ThisWorkbook.Sheets(i)
- For Each a In .Range(.[A2], .[A2].End(xlDown))
- If IsEmpty(d(a.Value)) Then d(a.Value) = a.Offset(, 1) Else d(a.Value) = a.Offset(, 1) - d(a.Value)
- Next
- End With
- End With
- .Close
- End With
- Next
- With Sheets(3)
- .[A1].Resize(d.Count, 1) = Application.Transpose(d.keys)
- .[B1].Resize(d.Count, 1) = Application.Transpose(d.items)
- End With
- End Sub
½Æ»s¥N½X |
|