DEAR ALL ¤j¤j
1.¦p¹Ï¤@µ{¦¡·|±N"«ü©w¸ê®Æ§¨ALL-EXCEL ¤§ALL SHEET ¦Û°Ê·J¾ã¦ÜÁ`ªíEXCEL-¨ÌÀɦW¦Û°ÊÅܧó¤u§@ªí¦WºÙ"
2.¦ý¤p§ÌY¶È»Ý ALL EXCEL ¤§ SHEET3¤§¤u§@ªí·J¾ã¦ÜÁ`ªíEXCEL.(¨ä¾lSHEET1 SHEET2 SHEET4...¤£»Ýn·J¾ã)
3.½Ð°Ý¸Ó¦p¦óקï.·Ð¤£§[½ç±Ð.THANKS*10000
¹Ï¤@
Sub yy()
Dim a As Workbook, f$, fn$, k%
Dim p$, Sh As Worksheet
Set a = ThisWorkbook
p = "C:\AAA\"
f = Dir(p & "*.xls")
Application.ScreenUpdating = False
Do While f <> ""
Workbooks.Open p & f
k = 0
For Each Sh In Worksheets
If Not IsEmpty(Sh.UsedRange) Then
fn = IIf(k = 0, Replace(f, ".xls", ""), Replace(f, ".xls", "_") & k)
Sh.Copy after:=a.Sheets(a.Sheets.Count)
ActiveSheet.Name = fn
k = k + 1
End If
Next
Windows(f).Close True
f = Dir
Loop
Application.ScreenUpdating = True
End Sub |