-
Solved: Test if Folder Exists
How do I test if a Folder exists? I use a persons excel username in excel to find their folder on our servers but sometimes people have incorrect usernames in Excel. I would like to test their username next to all the folders on the H drive and if that name does not exist I want to do a popup asking telling people to correct their username. I know how to do all of it except testing if a folder exists with that name.
-
Something like this perhaps:
[vba]
Sub DirctoryTest()
If Dir("H:\MyDirectory\", vbDirectory) = "" Then
MsgBox "Directory Does Not Exist"
Exit Sub
Else
MsgBox "Directory is Valid"
'Do Other Stuff
End If
End Sub
[/vba]
-
-
Nicely done!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules