- 帖子
- 471
- 主題
- 121
- 精華
- 0
- 積分
- 579
- 點名
- 0
- 作業系統
- WIN10
- 軟體版本
- OFFICE2019
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2015-4-16
- 最後登錄
- 2023-1-17
|
2#
發表於 2016-2-26 21:27
| 只看該作者
本帖最後由 starry1314 於 2016-2-26 21:29 編輯
回復 1# vavashop
我自己的做法,先複製好資料庫要貼至另一檔案的的範圍,
在執行你要執行的巨集- Sub 批次修改()
-
- ' 螢幕刷新,關閉
- Application.ScreenUpdating = False
- Dim filenames As Variant
- ''設置數組給變量和真為多選
- ' set the array to a variable and the True is for multi-select
- filenames = Application.GetOpenFilename(, , , , True)
- counter = 1
- ' 選擇要開啟的檔案
- While counter <= UBound(filenames)
- '打開選定的文件
- Workbooks.Open filenames(counter)
-
- '巨集---------------------
-
-
-
-
-
-
-
-
-
-
-
- '巨集---------------------
-
-
-
-
- '關閉選擇的檔案
-
- ActiveWorkbook.Close True
-
- '開啟新檔案
- counter = counter + 1
- Wend
-
- ' 螢幕刷新,開啟
- Application.ScreenUpdating = True
- End Sub
複製代碼 |
|