- ©«¤l
- 976
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 1018
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-4-19
- ³Ì«áµn¿ý
- 2024-10-30
|
¦^´_ 27# wang077
§Ú¤]¬O·s¤â¾Ç²ß¤¤¡A¼g±o¤£¦n½Ð¨£½Ì¡AÁÂÁ¡C
Sub ¿ï¾ÜÀÉ®×()
Dim Arr, WB, fc%, x%, fn$, n%
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
With Sheets("Á`ªí")
If .FilterMode Then .ShowAllData '¦³¿z¿ï®É¸Ñ°£¿z¿ï
.Range("a2:j" & .[a65536].End(3).Row) = "" '²M°£¸ê®Æ
With Application.FileDialog(msoFileDialogOpen) '¿ï¾Ü»Ý¨DÀÉ®×
.InitialFileName = "D:\" '¹w³]D¼Ñ
.AllowMultiSelect = True '¥i½Æ¿ï
.Show 'µe±Åã¥Ü
fc = .SelectedItems.Count 'pºâ¿ï¾ÜÀÉ®×¼Æ
If fc = 0 Then Exit Sub '¨S¿ïÀɮ׫hÂ÷¶}
Tm = Timer '¶}©lp®É
For x = 1 To fc
FPath = .SelectedItems(x) 'Àɮ׸ô®|
Set WB = Workbooks.Open(FPath) '¶}±ÒÀÉ®×
With Sheets(1) 'Àɮתº²Ä1 sheet
If .FilterMode Then .ShowAllData '¦³¿z¿ï®É¸Ñ°£¿z¿ï
Arr = .Range("a3:i" & .[a65536].End(3).Row) '¨Ó·½¸Ë¤J¼Æ²Õ
fn = Split(ActiveWorkbook.Name, ".")(0) '¨ú±oÀɦW
End With
WB.Close 'Ãö³¬¨Ó·½ÀÉ®×
n = [a65536].End(xlUp).Row + 1 'Á`ªíaÄæ³Ì«á¤@µ§¸ê®Æ+1ªº¦ì¸m
Range("a" & n).Resize(UBound(Arr), UBound(Arr, 2)) = Arr '¨Ó·½¶K¤JÁ`ªí
Range("j" & n & ":j" & [a65536].End(xlUp).Row) = fn '¨Ó·½ªºÀɦW¶K¤JÁ`ªí
Next
End With
End With
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.AskToUpdateLinks = True
MsgBox "°õ¦æ§¹¦¨" & Timer - Tm & " ¬í"
End Sub |
|