|
楼主 |
发表于 2023-5-11 21:56
|
显示全部楼层
- Dim arr(1 To 10000) As String
- Dim f, i, k, F2, f3, x
- Dim arr1(1 To 100000, 1 To 6) As String, q As Integer '6列放置文件夹的名称,大小,修改日期
- Dim fso As Object, myfile As Object
- Dim dig As Object
- Set dig = Application.FileDialog(msoFileDialogFolderPicker)
- With dig
- .Title = "请选择需要查找的文件夹"
-
- '如果沒选择文件夹路径退出程序,选择了就返回文件地址到arr(1)
- If .Show = 0 Then
- Exit Sub
- ElseIf .Show = -1 Then
- '如果选择的是驱动盘,如D:\,那就不需要在后面加""
- If VBA.Right(.SelectedItems(1), 1) = "" Then
- arr1(1, 1) = .SelectedItems(1)
- Else
- arr1(1, 1) = .SelectedItems(1) & ""
- End If
- End If
- End With
复制代码 |
|