+ Reply to Thread
Results 1 to 3 of 3

Save pdf to specifc year/month folder + manage folders based on CDate

  1. #1
    Registered User
    Join Date
    07-10-2015
    Location
    CZECH
    MS-Off Ver
    Office 365
    Posts
    53

    Save pdf to specifc year/month folder + manage folders based on CDate

    Hello experts,
    we have daily 15 savings of files to drive, I would like to have manage of files automatic in background. Please help me with:

    A) CREATING FOLDER, automatic saving to correct folder

    Could you please help me with code what based on „Curent date“ create folders to d:\Folder\
    1) if not existing – current Year – Then
    2) if not existing – current Month
    and save sheet as pdf in format
    Currentdate (YY-MM-DD-hh-mm-ss.pdf

    EXAMPLES:
    OVERVIEW 20-04-28-13-38-18.pdf
    saving to folder below (with creating year+month folder)
    d:\Folder\2020\04\

    OVERVIEW 20-05-15-13-20-10.pdf
    saving to folder below (with creating month folder)
    d:\Folder\2020\05\

    OVERVIEW 21-01-01-14-10-15.pdf
    d:\Folder\2021\01\

    .......

    B) MANAGE FOLDER, MOVE TO ARCHIVE

    Is there possible then based on actual date move whole folder to archive folder?
    With rule: with every creating of new month folder check move to archive minus 2 months – mean in 04 month move 02 folder, 05 month move 03 folder..etc.. only in 02 month move whole year folder to d:\Folder\2021\ to X:\Archive\ ?


    Thank you for help with code base.
    vendam
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Save pdf to specifc year/month folder + manage folders based on CDate

    Hi vendam,

    Try the following code in the attached sample file. You may have to modify the 3 lines in red at the top of the Code module to fit your specific requirements.

    I suggest you try the code on dummy folders before attempting to use it on real data, since file deletion is involved. Back up your files in the Source folder before you try the code on real data.
    Please Login or Register  to view this content.
    Please let me know if you have any questions and/or problems.

    Lewis

  3. #3
    Registered User
    Join Date
    07-10-2015
    Location
    CZECH
    MS-Off Ver
    Office 365
    Posts
    53

    Re: Save pdf to specifc year/month folder + manage folders based on CDate

    Dear Lewis,

    thank you very much for your help, tested and it works perfectly without no complication found.
    Saving created folders. After manual adding of old folder with files - macro sent all package to archive folder.

    Huge respect and thanks for help!

    vendam
    Attached Images Attached Images

+ 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. Create Year and Month Folders to Online SharePoint
    By E5254730 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2020, 03:22 AM
  2. Create a Month and Day Folder for Every day of Year
    By ptmuldoon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2018, 01:12 PM
  3. [SOLVED] Create new folder based on current year + save as
    By gliori in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2017, 07:54 AM
  4. [SOLVED] VBA Code to save to a folder within a folder within a folder all based on cell values.
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-24-2016, 04:24 PM
  5. [SOLVED] Creating a VBA Script to save in a current month's folder (create folder as needed)
    By spittingfire in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2015, 03:08 PM
  6. [SOLVED] How do I save to a folder that is the current month and have it save to next month"
    By shikano53 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-16-2014, 03:56 PM
  7. How to save file in respective month folder as per current year vba modification
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2014, 05:26 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