- 帖子
- 3
- 主題
- 0
- 精華
- 0
- 積分
- 3
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- office 2003
- 閱讀權限
- 10
- 性別
- 男
- 註冊時間
- 2013-1-31
- 最後登錄
- 2018-12-5
|
回復 9# Hsieh
請教各位高手大大
小弟想要使用選擇檔案 並將選擇之檔案 複製到d:\test 資料夾裡
但是 FILECOPY "來源","D:\test" 的來源想用變數取代 卻一直出現錯誤
可以麻煩高手幫忙看一下需要如何修改才能符合順利跑下去
Private Sub CommandButton1_Click()
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Show
For i = 1 To .SelectedItems.Count
Cells(i, 1) = .SelectedItems(i)
MsgBox .SelectedItems(i)
fs = .SelectedItems(i)
==> Private Sub CommandButton1_Click()
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Show
For i = 1 To .SelectedItems.Count
Cells(i, 1) = .SelectedItems(i)
MsgBox .SelectedItems(i)
fs = .SelectedItems(i)
fileCopy(fs,"d:\test")
Next
End With
End SubfileCopy(fs,"d:\test")
Next
End With
End Sub
感激 |
|