Excel VBA - How to Check if Folder Exists (Dir function)

preview_player
Показать описание
Excel VBA Check to see if a folder exists using Dir function

The code used in this video:

Sub CheckIfFolderExists()
Dim MyFolder As String
MyFolder = "C:\Reports1\"

If Dir(MyFolder, vbDirectory) "" Then
MsgBox "Folder exists"
Else
MsgBox "Folder does not exist"
End If

End Sub
Рекомендации по теме
welcome to shbcf.ru