+ Reply to Thread
Results 1 to 4 of 4

Lookup folder from cell text, then save excel file in this folder

  1. #1
    Registered User
    Join Date
    03-06-2014
    Location
    holland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Lookup folder from cell text, then save excel file in this folder

    Hi,

    I have been using this forum for a while now. Usually I can find similar problems and fixes in order to fix my problem. This time however I cannot find a suitable solution to this problem:

    I have alot of project folders on my harddrive. All in format: I:/12345-costumer-projectname/
    the five digits are unique for each project.

    I make calculations for these projects using an excel file. In this excel I also type the projectnumber (cell J2)
    Now i would like to make a button. When pressed, it checks the projectnumber cell J2, looksup the corresponding folder and saves the excelfile in PDF format in this folder.

    I have found macro to find files in folders, but none which do the above.
    Can anyone point me in the right direction? Thanks alot for your help!

    Best regards,
    Bob

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Lookup folder from cell text, then save excel file in this folder

    Use the dir function with a wildcard to return the full folder from the project number, i.e.:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-06-2014
    Location
    holland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Lookup folder from cell text, then save excel file in this folder

    Thanks for you help. The 12345 i need to replace by the value in cell J2. I tried:

    Please Login or Register  to view this content.
    But it doesn't work. I am having great difficulty to write my own code, but once i find something which comes close i usually can modify it to suit my needs.
    Last edited by dodgybob; 05-14-2014 at 06:52 AM.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Lookup folder from cell text, then save excel file in this folder

    Sorry, that would be like so:
    folder_name = dir("I:/" & Range("J2").Value & "*", vbdirectory)
    you need to split up the text strings and variables with &'s.

  5. #5
    Registered User
    Join Date
    03-06-2014
    Location
    holland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Lookup folder from cell text, then save excel file in this folder

    Got it to work. Thanks alot for your help. You have made my day!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Save File to folder Where folder is referenced in cell
    By Will_iam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2013, 08:35 AM
  2. Save a file to a folder, create folder if it doesn't exist
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-01-2010, 09:12 AM
  3. Create Folder with system date then save file to folder
    By cartotech81 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2009, 02:12 PM
  4. Replies: 6
    Last Post: 08-11-2006, 03:41 PM
  5. [SOLVED] Need code to save file to new folder, erase from old folder
    By Ron M. in forum Excel General
    Replies: 1
    Last Post: 02-24-2006, 02:10 PM

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