+ Reply to Thread
Results 1 to 2 of 2

Need help with code to save file in a folder location based on a cell value

  1. #1
    Registered User
    Join Date
    07-09-2014
    Location
    Naperville, IL
    MS-Off Ver
    office 2013
    Posts
    29

    Need help with code to save file in a folder location based on a cell value

    Hello,

    Here is what my code currently does - It loops through the values in column 4, filters the data, pastes the data to a new sheet, creates a PDF and saves the file in the file path that I specify in cell A12. Currently, all files created are saved within the same folder.

    What I need the code to do - I need the code to catch the value of the first column (manager) and save the data within that specific folder. For example, all the data for "Employee A" will be saved in the folder called "John". I do not need the macro to create the individual folders, I can do that manually. What is the best way to do this? I believe I need to somehow tell the Filename argument to pick this up but I keep getting errors.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-09-2014
    Location
    Naperville, IL
    MS-Off Ver
    office 2013
    Posts
    29

    Re: Need help with code to save file in a folder location based on a cell value

    I figured it out. I made a mypath2 variable which was just my original file path and the manager name added on the end. I then set mypath2 back to the original mypath variable before the loop to make sure mypath2 had the correct file path every time.

    However, if anyone has a more efficient way to do this (less error prone or faster), I'd be happy to take the advice. Thanks for reading!

    Please Login or Register  to view this content.
    Last edited by msantucci; 03-10-2015 at 05:59 PM.

+ 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] Need code to copy data based on filter criteria to new workbook as save in a file location
    By msantucci in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-24-2015, 02:47 AM
  2. [SOLVED] Macro to Save File to Location Folder Based on Date in Cell
    By John_Day83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2013, 05:34 PM
  3. [SOLVED] [Help]macro to open file browser, to select a location, and save the location to a cell
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2013, 09:56 AM
  4. Replies: 1
    Last Post: 09-12-2012, 11:29 AM
  5. Macro to save duplicate file and create folder name based on cell value
    By munkee in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-19-2012, 12:09 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