+ Reply to Thread
Results 1 to 4 of 4

Rename and move files to a prespecified location

  1. #1
    Registered User
    Join Date
    12-06-2019
    Location
    Athens, Greece
    MS-Off Ver
    365
    Posts
    6

    Rename and move files to a prespecified location

    Dear all,

    I want to be able to rename some files (of different formats: xls, pdf, dwg, dgn...etc...) to an already created folder structure.

    I receive an excel sheet (see attachment) along with the documents i receive. I want to have a template excel with a macro that does the following:

    1. I firstly copy-paste the information shown in the excel I attached, to the new template excel with the macro.
    2. The files are named as stated in cell A (i.e. 483-21-DT-M-00300-Ed001.pdf) but i want to rename them as follows:

    "Cell E" & "space" & "Rev." & "Cell C" & "space" & "(" & "Cell F" & ")"

    3. When the files are physically renamed, then they should be moved to the location (network drive) as it is shown in cell G BUT instead of PROJECT_483, this should be replaced with W:\GR-IPP_II\02.*Engineering
    4. In case a file misses an information (i.e. cell E or F is left blank) a "-" should be placed in the file name and then it shall be moved to the path.

    in the above example the 483-21-DT-M-00300-Ed001.pdf will be renamed as 111915-21-YDS-MDD-EA-00300 REV.1 (P&ID SYMBOLOGY AND GENERAL NOTES).pdf and the path shall be: W:\GR-IPP_II\02.*Engineering\200 Mechanical Area\221 Systems\221.01 P&IDs\111915-21-YDS-MDD-EA-00300 REV.1 (P&ID SYMBOLOGY AND GENERAL NOTES).pdf

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Rename and move files to a prespecified location

    Can you show what you have tried to do and what is not working for you.

    Your thread title is misleading here is a code to move files and rename them

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-06-2019
    Location
    Athens, Greece
    MS-Off Ver
    365
    Posts
    6

    Re: Rename and move files to a prespecified location

    I am sorry if i misled. I receive everyday a csv file with the actual files listed in the excel and with the information as shown in the attached file. I need to have the files to change their names (as stated above) and then moved to the path as shown in the last column (with the change to the correct directory)

    I want to do all that to an xlsm file, so i need to copy-paste the information of the csv everyday i receive a new one. I haven't used VBA for ever and i am stuck!

  4. #4
    Registered User
    Join Date
    12-06-2019
    Location
    Athens, Greece
    MS-Off Ver
    365
    Posts
    6

    Re: Rename and move files to a prespecified location

    I am not trying to change the name in the excel, but at the actual files.
    To do that i need to collect the information from the cells "Cell E" & "space" & "Rev." & "Cell C" & "space" & "(" & "Cell F" & ")"

    Then the path to move them, is half stated in the last column so it needs to be correctly created since the directory's folder structure is already there

+ 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. Rename Files and move them to a cell related location
    By Chrysanthiiiiii in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2019, 11:55 AM
  2. Rename & move/copy files according to lists using scripts?
    By bcianni in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-22-2019, 12:38 PM
  3. 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
  4. Excel to move and rename files
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2012, 07:01 PM
  5. [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
  6. Replies: 1
    Last Post: 10-06-2008, 10:29 PM
  7. Macro to rename and move files
    By Caroline25 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-15-2007, 03:11 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