Posts by nfoster

    Re: VBA to save reports, generated using macros, to specific folders


    Thank you. Well, its the same code that you helped with earlier wherein it would save the generated reports into existing folders by looking up the client name in column B, city name in column I and then search for current year, then current month, and finally current date where the report should be saved. Presently the macro is configured to save the file in the following structure: client name> city name > current month > current date > save. I would like to modify it to save it by client name > city name > current year > current month > current date > save. I am reattaching the report template for reference. Your help is much appreciated.


    I have a set of macros to generate multiple reports which works fine. However, I would like to include a VBA script to save the generated reports into specific folders depending on the name of the report that is being generated. When I generate reports using macros, the files are saved as per the name of the city to the local drive. What I'm looking for is to have the macro search up the corresponding folder (matching the name of the report) in the local drive and place it under a folder with the current date. For example, my macro saves all the reports (city names) for my client AFD to D: after which I have to manually place the files to its respective folders. I would like for it to search the directory for a folder called AFD > city name > current month > current date > save. There are a total of 25 clients and 175 cities.


    Here's the VBA code I use to generate the reports. Any help is greatly appreciated.