+ Reply to Thread
Results 1 to 6 of 6

Creating Folders.

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Creating Folders.

    Hello everyone. I am using the following VBA code to create a folder:

    Please Login or Register  to view this content.
    I am trying to create a code that is a little more "dynamic". I want to write VBA code that will create a userform where the user is prompted for the date (MM_DD_YYYY) for instance: "Please Enter the date". The macro will then take that date and create a folder named "MM_DD_YYYY_157. If the folder already exist I need an error message which will promt the user to enter in the correct date, "Incorrect date, please try again!"

    Any suggestions would be appreciated.
    Last edited by AnthonyWB; 04-08-2010 at 12:24 PM.

  2. #2
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Creating Folders.

    I also need to create two subloders in the "MM_DD_YYYY_157" folder named, "MM_DD_YYYY_157"_reports and "MM_DD_YYYY_157_Support_Summaries".

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Creating Folders.

    Here's how I would write that:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 04-08-2010 at 11:53 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Creating Folders.

    Correction:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Creating Folders.

    Thank you !

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Creating Folders.

    You know, now that you're trying to make multiple folders, a little more robust response to finding folders already created is probably in order... try this and try running it on the same date more than once...
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 04-08-2010 at 01:29 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1