- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-8-2 16:55 ½s¿è
¦^´_ 12# Jared - Option Explicit
- Sub Ex()
- Dim Rng As String, Ar(1 To 3), A(), i As Integer, ii As Integer, X As Integer
- 'n¦X¨Ö ¤TÓÀÉ®×. -> Ar(1 To 3)
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- A = Array("D:\¤u§@Á`ªí\¤p©ú.xls", "D:\¤u§@Á`ªí\¤pµØ.xls", "D:\¤u§@Á`ªí\¤p¬ü.xls") '¸ô®|¤ÎÀɦW½Ð¨Ì»Ý¨Dקï
- Rng = "A1:E10" '©w©Ò¦³Àɮצb¬Û¦Pªº½d³ò
- For i = 0 To UBound(A)
- With Workbooks.Open(A(i)).Sheets(1) 'With ³¯z¦¡ ¦b¤@Ó³æ¤@ª«¥ó©Î¤@ӨϥΪ̦Ûq«¬ºA¤W°õ¦æ¤@¨t¦Cªº³¯z¦¡¡C
- Ar(i + 1) = .Range(Rng).Value '¤Gºû°}¦C:²Ä¤@ºû = ¤u§@ªíªº¦C,²Ä¤Gºû = ¤u§@ªíªºøó,
- .Parent.Close
- End With
- Next
- ReDim A(1 To UBound(Ar(1), 1), 1 To UBound(Ar(1), 2)) '°}¦C «·s°t¸m ºû¼Æ¤Îºû¼Æ¤¸¯À¤§¤W¤U¯Á¤ÞÈ-> "A1:E10" ªº¤j¤p
- For X = 1 To UBound(Ar)
- For i = 1 To UBound(Ar(1), 2) 'Äæ
- For ii = 1 To UBound(Ar(1), 1) '¦C
- If ii = 1 Or i = 1 Then
- A(ii, i) = Ar(X)(ii, i) '²Ä1¦C ©Î ²Ä1øó
- Else
- If Ar(X)(ii, i) <> "" Then A(ii, i) = A(ii, i) + 1 '¦³¸ê®Æ + 1
- End If
- Next
- Next
- Next
- Workbooks("®È¹C¦aÂI²Îp.xls").Sheets(1).Range(Rng) = A
- Application.ScreenUpdating = True 'µ²§ô«á§ó·s¿Ã¹õ
- Application.DisplayAlerts = True
- End Sub
½Æ»s¥N½X |
|