DEAR ALL 大大
1.圖一於 2003 版本(65536列)書寫之程式 ,使用 OK
2.同事於EXCEL新版電腦開機時出現BUG停於 sh.Copy after:=a.Sheets(a.Sheets.Count)
秀出 "包含之列欄比來源資料少"???
2.1 2003版65536列 新版一定>65536 ??
3.如何修改,煩不吝賜教. THANKS*10000
圖一
Sub yy()
Dim a As Workbook, f$
Dim p$, sh As Worksheet
Set a = ThisWorkbook
p = "D:\AAA\"
f = Dir(p & "*.txt")
Application.ScreenUpdating = False
Do While f <> ""
Workbooks.Open p & f
For Each sh In Worksheets
On Error Resume Next
sh.Copy after:=a.Sheets(a.Sheets.Count)
Next
Windows(f).Close True
f = Dir
Loop
Application.ScreenUpdating = True
Sheet1.Select
Range("A1").Select
End Sub