Skip to content

Instantly share code, notes, and snippets.

@brazilnut2000
Last active August 29, 2015 14:19
Show Gist options
  • Save brazilnut2000/93ed4b348bc55c8d9f43 to your computer and use it in GitHub Desktop.
Save brazilnut2000/93ed4b348bc55c8d9f43 to your computer and use it in GitHub Desktop.
VBA: Creates a directory if it doesn't exist
Sub TestCreateDirIfNeeded()
Dim path As String
path = "C:\imarealboy"
CreateDirIfNeeded (path)
End Sub
Sub CreateDirIfNeeded(path As String)
On Error Resume Next
MkDir path
On Error GoTo 0
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment