Results 1 to 8 of 8

VBA to rename files and move them to a different folder

Threaded View

  1. #1
    Registered User
    Join Date
    03-27-2013
    Location
    Wiltshire, England
    MS-Off Ver
    MS 365
    Posts
    84

    Question VBA to rename files and move them to a different folder

    On my computer I have a source folder:
    C:\Users\jonat\Documents\Finance

    And also a folder for a weekly archiving process.
    C:\Users\jonat\Documents\Archive

    In the source folder I have my weekly files. I am using 5 for this example, but in reality I have far more.
    Taunton - Current Week.xlsx
    Newbury - Current Week.xlsx
    Exeter - Current Week.xlsx
    Plymouth - Current Week.xlsx
    Bristol - Current week.xlsx

    I am hoping someone can provide some vba code which will:-
    Rename all the files in the source folder, replacing Current Week with the Period in cell B1 and the Week in cell B2.
    And move the renamed files from the source folder to the archive folder.

    So for example.
    Before vba is run.
    Taunton - Current Week.xlsx starts in source folder.
    After vba is run
    We have Taunton - P13 W1.xlsx in archive folder.

    I change the variables in cell B1 and B2 each week.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Loop through all files in a folder and rename the files considering a pattern
    By excelactuary in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-22-2022, 10:57 AM
  2. [SOLVED] Copy Folder then rename files in new folder from list in Excel
    By jimjones1958 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2021, 05:00 PM
  3. Ability to rename multiple files from a path and move and rename to another.
    By X82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2020, 09:54 PM
  4. Replies: 1
    Last Post: 01-28-2019, 06:55 PM
  5. Replies: 18
    Last Post: 11-27-2018, 05:25 AM
  6. Macro to move files from one folder to another but rename duplicates
    By mark_anthony in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-09-2014, 06:56 AM
  7. [SOLVED] Move, Rename all files from a folder
    By kinseld5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2012, 12:20 PM

Tags for this Thread

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