如何用EXCEL制作文件目录
答案:2 悬赏:20 手机版
解决时间 2021-02-11 07:27
- 提问者网友:放下
- 2021-02-10 17:49
如何用EXCEL制作文件目录
最佳答案
- 五星知识达人网友:零点过十分
- 2021-02-10 19:15
Excel 制作文件目录没有任何便利性可言。
文件目录这种对格式要求高的东西,Word 是天生的好手,尤其是能生成基于标题样式(大纲级别)的自动目录。
文件目录这种对格式要求高的东西,Word 是天生的好手,尤其是能生成基于标题样式(大纲级别)的自动目录。
全部回答
- 1楼网友:平生事
- 2021-02-10 20:23
插入代码 dim fso as new filesystemobject dim fld as folder dim srow as single sub filesearchtools() dim srchdir as string, srchstring as string dim fdialog as filedialog srow = 0 set fdialog = application.filedialog( _ msofiledialogfolderpicker) if fdialog.show = -1 then srchdir = fdialog.selecteditems(1) else msgbox "没有选择任何目标文件夹!", _ vbcritical, "文件搜索工具" exit sub end if srchstring = inputbox("请输入搜索的文件类型:", _ "文件类型", "*.*") if len(srchstring) = 0 then srchstring = "*.*" with activesheet.columns(1) .cells.clear call filefind(srchdir, srchstring) .autofit end with end sub private sub filefind(byval srchfld as string, _ srchfile as string, _ optional srchdir as boolean = true) dim tfld as folder dim dirfname as string on error goto errhandle set fld = fso.getfolder(srchfld) dirfname = dir(fso.buildpath(fld.path, srchfile), _ vbnormal or vbhidden or vbsystem or vbreadonly) while len(dirfname) <> 0 srow = srow + 1 with activesheet .hyperlinks.add anchor:=.cells(srow, 1), _ address:=fso.buildpath(fld.path, dirfname), _ texttodisplay:=dirfname end with dirfname = dir() wend if fld.subfolders.count > 0 and srchdir then for each tfld in fld.subfolders call filefind(tfld.path, srchfile) next end if exit sub errhandle: msgbox "运行错误!", vbcritical, "文件搜索工具" end sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯