excel vba check if folder exists code example
Example 1: vba check if file exists
Public Function IsFile(s)
IsFile = CreateObject("Scripting.FileSystemObject").FileExists(s)
End Function
Example 2: excel vba check if directory exists
Public Function IsDir(s)
IsDir = CreateObject("Scripting.FileSystemObject").FolderExists(s)
End Function