怎么用EXCEL制作文件目录

excel

1个回答

写回答

1137128646

2025-09-15 21:15

+ 关注

excel
excel

以下是使用excel制作文件目录的代码:VBASub FileDirectoryCreation()Dim fs As FileSystemObjectDim folder As FolderDim i As LongSet fs = New FileSystemObjectSet folder = fs.GetFolder("C:")For i = 1 To folder.FileCount i = i + 1 Debug.Print folder.Name & " - " & folder.Files(i).NameNextEnd Sub这个代码会创建一个名为"F360问答工具"的文件夹,并在其中放置一些子文件夹和文件。然后,该代码将显示该文件夹中的所有子目录和文件名称。请注意,此代码需要将"FileDialog"函数导入到VBA编辑器中才能正常运行。

举报有用(4分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号