查找某个文件夹下,是否存在某个文件。
Sub dfads()
For Each file In fso.GetFolder(ThisWorkbook.path).Files
    If InStr(file.Name, "xiyouji") Then
        Debug.Print file.Name
        Exit For
    End If
    
Next
End Sub
查找某个文件夹下,是否存在某个文件。
利用for循环遍历文件;
然后利用instr函数;
找到后就退出for循环。
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号