+ Reply to Thread
Results 1 to 6 of 6

Dir Name to Date?

  1. #1
    Forum Contributor
    Join Date
    01-09-2009
    Location
    Cedar Hill, Tx
    MS-Off Ver
    Excel 2003
    Posts
    200

    Dir Name to Date?

    Howdy, folks:

    I have a series of workbooks, each within a "month" directory - for example: "Jan 11", "Feb 11" - in the format of "mmm yy". I'm looking for a way for each workbook to look to it's directory and come up with an associated date. As an example, the file within the "Mar 11" folder would look at it's location and return a date of "03/01/2011" in the format of mm/dd/yyyy. A function, perhaps? Any ideas?

    TIA.

    Bob

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Dir Name to Date?

    Hello Bob,

    Are you saying the workbook named named "Mar 11.xls" is stored in the directory named "03/01/2011" ?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    01-09-2009
    Location
    Cedar Hill, Tx
    MS-Off Ver
    Excel 2003
    Posts
    200

    Re: Dir Name to Date?

    No, the directory name would be like "Mar 12" and from that name, I need to come up with "03/01/2011". The workbooks within that directory will have various names - a.xls, b.xls, etc.

    Bob
    Last edited by bstubbs; 12-17-2010 at 12:11 PM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Dir Name to Date?

    Hello Bob,

    If the workbook is named "03/11/2010.xls" then you can trim the name and convert it into a date. I know how to do this in VBA for you but not sure how to do it with formulas.

  5. #5
    Forum Contributor
    Join Date
    01-09-2009
    Location
    Cedar Hill, Tx
    MS-Off Ver
    Excel 2003
    Posts
    200

    Re: Dir Name to Date?

    It's not the workbook but the directory that has the "date formatted" name. How 'bout this: how can I come up with the current directory name using VBA?

    Thanks.

    Bob

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Dir Name to Date?

    Hello Bob,

    The VBA code would be
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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