+ Reply to Thread
Results 1 to 5 of 5

Migrating a lot of excel files between folders

  1. #1
    Registered User
    Join Date
    03-06-2016
    Location
    Germany
    MS-Off Ver
    2010
    Posts
    3

    Migrating a lot of excel files between folders

    Hello guys,

    I registered here because I'm a bit lost with a task I have at hand. I want to change some directory names in a big structure but the problem is there are laying a lot of excel files there that reference each other. So if I change the structure there will be a lot errors popping up. I had the idea of scanning all those files for references, writing them out, run a script for find and replace on the old stuff and then write it back.

    Here is some of the stuff I already pieced together with google and co.

    To check for links in a file and write them out.

    Please Login or Register  to view this content.

    Then I run the following code to change all the references.

    Please Login or Register  to view this content.
    Now I'm lost for two things. What is the best way to write all those formulas back into their stuff and the second bigger thing, how do I make this thing dynamic that it does this stuff over whole folders with hundreds of excel files?

    For the writing back stuff I now have a new sheet in my excel file with the following structure:

    SheetName, Index of Cell, Formula

    So my idea is to convert everything to an array and then do something like

    sheet name!index = formula

    in a loop over the full array.

    But I fear that this isn't very practical from a performance point of view with 8000 formulas in a file.

  2. #2
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Migrating a lot of excel files between folders

    This should work:
    To deal with errors in links:
    If the link file is not in the folder or the path does not exist, Excel makes you set it up at the time.
    To prevent this happening when the code is running, the code switches off Display Alerts, and writes a note in column D if there is an error. It writes the formula (with its original link) in column E and puts text "Link Not Found" in column D.
    The original formula is written back to the linked cell.
    It should run quickly


    Insert it in Sub ReplaceEPP4_grob AFTER line
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-06-2016
    Location
    Germany
    MS-Off Ver
    2010
    Posts
    3

    Re: Migrating a lot of excel files between folders

    After I killed the "Option Explicit" it seems to work but it takes really Long. The example file I used it on has something like 2500 formulas with links in it.

  4. #4
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Migrating a lot of excel files between folders

    How long is it taking for you?
    with 2500 links it runs in 12 seconds for me

    Use this instead will cut the time by 70% but you will have to find cell errors yourself
    Please Login or Register  to view this content.
    Last edited by Kevin#; 03-07-2016 at 09:29 AM.

  5. #5
    Registered User
    Join Date
    03-06-2016
    Location
    Germany
    MS-Off Ver
    2010
    Posts
    3

    Re: Migrating a lot of excel files between folders

    I will give it a try. Thanks a lot.

+ 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 folders and save text files to these folders
    By bloomingcarrot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2014, 08:14 PM
  2. Use Excel VBA to Copy multiple files from different source folders to different folders
    By mm1234mail in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2014, 01:17 PM
  3. Replies: 1
    Last Post: 09-12-2013, 09:23 PM
  4. Recursively Count Files in Folders and Sub-Folders
    By cdeshaz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-01-2013, 01:15 PM
  5. Replies: 1
    Last Post: 02-29-2012, 01:15 PM
  6. Create folders and move and copy files into that folders
    By vijaybharthi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2010, 04:01 AM
  7. [SOLVED] Open Excel files/folders
    By animalfriend7 in forum Excel General
    Replies: 1
    Last Post: 06-23-2005, 07:05 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