Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Create Directory Function?

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,
    I want to write a macro that creates directories. I want to create about 200 directories that are named based on the loop definitions.
    Is there a way to automate this task?

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    When you say 'loop definition' I assume you want folder names like Name 1, Name 2 and so on. Give this a go:-

    Code:
    Sub CreateDirectories()
    Dim lngFileNum As Long
    For lngFileNum = 1 To 200
        MkDir "C:tempNew Folder " & lngFileNum
    Next
    End Sub
    Hope it helps,
    D

    [ This Message was edited by: dk on 2002-03-08 08:30 ]

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    That helps!

    thanks

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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