Consulting

Results 1 to 2 of 2

Thread: Check if Directory Exists

  1. #1

    Check if Directory Exists

    Hello everyone,

    I'm relatively new to VBA but I really love it.
    I am looking for a way to let excel check if a directory excists and if not, create it.
    I find the comments in here very helpfull but i cant work out how to use a generated path.

    I use the concatenate formula to generate the path and directory name in colom A (for example).
    This path and directory is different in every row and i would like VBA to use this data te check if it excists and if not, create it.

    Would this be possible?

    Thnx in advance!

    Danny

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I don't bother checking, just create it with an error wrap

    On Error Resume Next
    For i = 2 To 10
    MkDir Cells(i, "A").Value 
    Next i
    On Error Goto
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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