+ Reply to Thread
Results 1 to 6 of 6

Dynamic Save to Folder Based on Cell Contents

  1. #1
    Registered User
    Join Date
    07-31-2009
    Location
    Gilbert, Az
    MS-Off Ver
    Excel 2007
    Posts
    30

    Dynamic Save to Folder Based on Cell Contents

    Hello All,
    Thanks to Mania112 I have a great code that sends a PDF via email of my worksheet. And thanks to Leith it is working wonderfully with the few tweaks he provided. Now I need to take it to the next level and could use some more help. Im not sure if this is possible but here goes:
    I have my code creating a file name made up of text and cell references
    Please Login or Register  to view this content.
    On a shared drive I have folders for our different pieces of equipment. These folder names are the same as cell "C7" inputs in my worksheet. Cell "C7" is changed by the user when working on a specific piece of equipment, and is that equipments ID#. What I need to have happen is save the created PDF to the specific equipment ID# folder on my shared drive (H:/). This macro is fired by button click. The path to the proper folder would need to change every time cell "C7" changed in order to go into the proper folder. I assume this save would need to happen prior to the killing of the temp file. But where exactly, and what would I need to have as the code to do this dynamic save?
    Thank you all in advance for your help. Here is the full code I have.
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    07-31-2009
    Location
    Gilbert, Az
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Dynamic Save to Folder Based on Cell Contents

    I hope everyone had a good weekend.

    Any thoughts on my question above?

  3. #3
    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: Dynamic Save to Folder Based on Cell Contents

    Hello dthhal,

    I don't have Excel 2007 so I am not sure the changes I made will work. Try it out and let me know. Here is code with changes marked in blue. The Temp File is moved to the new location.
    Please Login or Register  to view this content.
    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!)

  4. #4
    Registered User
    Join Date
    07-31-2009
    Location
    Gilbert, Az
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Dynamic Save to Folder Based on Cell Contents

    Thanks Leith. I'll give it a try and let you know. I appreciate you help once again.

  5. #5
    Registered User
    Join Date
    07-31-2009
    Location
    Gilbert, Az
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Dynamic Save to Folder Based on Cell Contents

    Hi Leith,
    I have tried the code and unfortunately have had no luck. The macro will run without errors, but no longer creates the .pdf in the email, nor saves to the shared drive. I have tried manipulating the code to the best of my ability but fall short. Any other thoughts on how I might accomplish it? I have attached a workbook for an example of what Im trying to accomplish.

    Also, to help clarify the path it would need to be as follows:

    H:\Folder1\Sub Folder1\Sub Folder2\QC Sheet\Sheet Range "C7"\ & TempFileName

    The Sheet Range"C7" is a user input for an equipment number. Each piece of equipment has its own folder so the save would need to be directed to the proper folder based on C7.

    Thanks for the help.
    Attached Files Attached Files

  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: Dynamic Save to Folder Based on Cell Contents

    Hello dthhal,

    Unfortunately, I don't have Excel 2007 and I don't have an Add-In to produce PDF files. I try looking over the code and see if I can locate any errors in the code or logic (quite possible).

+ 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