返回列表 上一主題 發帖

請問如何用VBA開啟檔案總管視窗讀取Folder或Files的路徑or檔名

  1. Private Sub CommandButton1_Click()
  2. With Application.FileDialog(msoFileDialogOpen)
  3.    .AllowMultiSelect = True
  4.    .Show
  5.    For i = 1 To .SelectedItems.Count
  6.      Cells(i, 1) = .SelectedItems(i)
  7.      MsgBox .SelectedItems(i)
  8.    Next
  9. End With
  10. End Sub
複製代碼
學海無涯_不恥下問

TOP

        靜思自在 : 原諒別人就是善待自己。
返回列表 上一主題