1.UsedRange myRow = UBound(arr, 1) myCol = UBound(arr, 2) For i = 1 To myRow Open ThisWorkbook.Path & "\" & arr(i, 1) & "1.txt" For Output As #1 Print #1, Join(Application.Index(arr, 1), ",") Print #1, Join(Application.Index(arr, i), ",") Close #1 Next End Sub 这个指令具体是什么意思是需要系统学习VBA的,非专业人员只需要复制就ok了。