- 帖子
- 31
- 主題
- 6
- 精華
- 0
- 積分
- 59
- 點名
- 0
- 作業系統
- win 7
- 軟體版本
- office 2007
- 閱讀權限
- 20
- 性別
- 女
- 註冊時間
- 2013-4-4
- 最後登錄
- 2013-9-2
|
2#
發表於 2013-5-27 11:04
| 只看該作者
目前研究出選取夾帶檔案路徑為:- Sub Import1()
- Dim fd As FileDialog
- Set fd = Excel.Application.FileDialog(msoFileDialogFilePicker)
-
- fd.Filters.Add "Excel File", "*.xls*" 'set the catch function
- fd.Filters.Add "Word File", "*.doc*"
- fd.Filters.Add "Txt File", "*.txt*"
- fd.Filters.Add "all files", "*.*"
-
- fd.Show 'show the dialog window
-
- For i = 1 To fd.SelectedItems.Count
- strFullName = fd.SelectedItems(i)
- Sheet1.Cells(i, 1) = strFullName 'appear the selection file name
-
- n = rinstr(strFullName, "\")
- Next
- End Sub
- Function rinstr(ByVal t As String, ByVal s As String)
- 'search the last string position
- Dim i As Integer
- Dim n As Integer
- n = 0
- For i = 1 To Len(t)
- If Mid(t, i, 1) = s Then
- n = i
- End If
- Next
- rinstr = n
- End Function
複製代碼 目前插入路徑的位置為a1,請問要如何指定插入的儲存格位置呢?謝謝 |
|