关于vba中 遍历文件夹的问题
SubgetFiles()DimpathoffilesAsStringDimtempAsString,ipathoffiles="D:\excel\vba"IfRight...
Sub getFiles()
Dim pathoffiles As String
Dim temp As String, i
pathoffiles = "D:\excel\vba"
If Right(pathoffiles, 1) <> "\" Then pathoffiles = pathoffiles & "\"
temp = Dir(pathoffiles & "*", vbDirectory + vbHidden + vbNormal + vbReadOnly + vbSystem)
Do While temp <> ""
If temp <> "." Or temp <> ".." Then
i = i + 1
Cells(i, 1) = pathoffiles & temp
temp = Dir()
End If
Loop
End Sub
想请教下上面这段代码中
条件判断 temp <> "." Or temp <> ".." 是什么意思 展开
Dim pathoffiles As String
Dim temp As String, i
pathoffiles = "D:\excel\vba"
If Right(pathoffiles, 1) <> "\" Then pathoffiles = pathoffiles & "\"
temp = Dir(pathoffiles & "*", vbDirectory + vbHidden + vbNormal + vbReadOnly + vbSystem)
Do While temp <> ""
If temp <> "." Or temp <> ".." Then
i = i + 1
Cells(i, 1) = pathoffiles & temp
temp = Dir()
End If
Loop
End Sub
想请教下上面这段代码中
条件判断 temp <> "." Or temp <> ".." 是什么意思 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询