Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Sherbrooke, Qc, Canada, Quebec, Canada
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating sub-directories from VBA code. (Excel 97)

    I need my VBA code to be able to check for the existance of some directories, if it exists just open it.
    If the directory does not exist, create it on the fly.

    How would one do that ?

    Thanks

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating sub-directories from VBA code. (Excel

    Something like this should do it:

    <pre>Dim strDirName As String
    strDirName = Dir("c:WorkMDTest", vbDirectory)
    If strDirName = "" Then
    MkDir ("c:WorkMDTest")
    End If
    </pre>

    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •