.和..是当前目copy录和上级目录,代码修改下:zhidaoDim spath As S" />
乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > <em>EXCEL</em> <em>VBA</em> Dir 函数-e

<em>EXCEL</em> <em>VBA</em> Dir 函数-e

作者:乔山办公网日期:

返回目录:excel表格制作


多截点图,就这几句看不出来问题再哪儿.

.和..是当前目copy录和上级目录,代码修改下:zhidao
Dim spath As String, patha As String
Dim sfilename As String
Dim rown As Long

spath = Cells(2, 1).Value & Application.PathSeparator
sfilename = Dir(spath & "*", vbDirectory)
rown = 4
Do While sfilename <> ""
if sfilename<>"." and sfilename<>".." then
Cells(rown, 1).Value = sfilename
end if
sfilename = Dir
rown = rown + 1
Loop

可以,代码如下:

n = "abc.txt"
p = "d:\a\"
if dir(p & n)="" then p = "d:\b\"
msgbox "完整路径:" & p & n


使用vba来实现
使用dir或者fso文件系统对data文件夹里 *.CATPart进行遍历并提取内容
直接写入要求的区域内即可

相关阅读

  • <em>EXCEL</em> <em>VBA</em> Dir 函数-e

  • 乔山办公网excel表格制作
  • 多截点图,就这几句看不出来问题再哪儿.excel中vba用dir,有一..." src="/uploads/tu/647.jpg" style="width: 400px; height: 267px;" />.和..是当前目copy录和上级目录,代码修改下:zhidaoDim spath As S
关键词不能为空

ppt怎么做_excel表格制作_office365_word文档_365办公网