+ Reply to Thread
Results 1 to 4 of 4

Open File from specific folder

  1. #1
    Registered User
    Join Date
    03-26-2009
    Location
    90210
    MS-Off Ver
    Excel 2003
    Posts
    2

    Open File from specific folder

    I'm attempting to simply a process at work. Our "computer guy" has no idea how to do this. We have an .html file saved with the date as part of the file name and into a folder that is something like d/rdrive/archive/03232009 that has the date at the end. i'm wanting to be able to enter the date in a cell and have the macro open the specific folder and file. i have most of it down, i just need to know how to get into the folder based on cell input....thanks in advance for the help!

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Open File from specific folder

    i have most of it down, i just need to know how to get into the folder based on cell input
    So what do you need? The VBA code to open a specific folder or the formula to construct your filename?

  3. #3
    Registered User
    Join Date
    03-26-2009
    Location
    90210
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Open File from specific folder

    the vb code to look in the folder based on date which is the folder name. I have the code to look in the folder above the date folders but it looks in ALL the sub folders for the file. I can't figure out how to get into the date specific folder. what i would like is to be able to enter the date i want to search in say cell a1...does that make sense?
    the code is at work..i'm not. so sorry i can't be more specific....

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Open File from specific folder

    OK,
    so you can open the folder one level above, which probably is

    d/rdrive/archive

    Now you need to change that string to be d/rdrive/archive/03232009 and open that folder instead.

    If you have a date in A1, you can construct the string in a cell this way:

    ="d/rdrive/archive/"&TEXT(MONTH(A1),"00")&TEXT(DAY(A1),"00")&TEXT(YEAR(A1),"00")

    There are similar functions to construct the string in VBA.

    Does that get you started?

+ 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