圖一
Sub yy()
Dim a As Workbook, f$, fn$, k%
Dim p$, Sh As Worksheet
Set a = ThisWorkbook
p = "C:\AAA\"
f = Dir(p & "*.TXT")
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, ".TXT", ""), Replace(f, ".TXT", "_") & 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
MsgBox "銅面積.TXT 資料抓取至EXCEL-OK"
Sheet1.Select
Range("A1").Select
End Sub