- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
回復 4# character - Sub 加入檔案()
- fds = Application.GetOpenFilename("Excel Files (*.xls;*.xlsx), *.xls;*.xlsx", , , , True)
- If IsArray(fds) Then
- For i = 1 To UBound(fds)
- [A1].Offset(i - 1) = fds(i)
- Next
- End If
- End Sub
- Sub 執行()
- For Each a In Range([A1], Cells(Rows.Count, 1).End(xlUp))
- With Workbooks.Open(a)
- .Sheets(1).[A1:C6].Copy ThisWorkbook.Sheets("Result").Cells(Rows.Count, 1).End(xlUp).Offset(1)
- .Close 0
- End With
- Next
- End Sub
複製代碼 |
|