+ Reply to Thread
Results 1 to 4 of 4

Merge multiple excel files from two folder locations

  1. #1
    Registered User
    Join Date
    08-05-2021
    Location
    Manchester
    MS-Off Ver
    365
    Posts
    2

    Post Merge multiple excel files from two folder locations

    Hi all,

    i am new to VBA, but wanting to automate a manual process.

    I have two folders locations (file paths set within two respective cells). I want the macro to look within both folders and combine (PLTs - text files) within the current sheet.

    I have this Macro presently, which is looking at the first folder (C5), then following onto the next (C6). However, when I press run, the second Macro (irrespective of configuration) doesn't work. I think it may have something to do with defining the Path, but have tried various variables. Can someone please help?

    The end goal is to integrate more folder lookups within the Macro, but just limiting it to two at the moment - so any help around this is appreciated.


    Please Login or Register  to view this content.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,401

    Re: Merge multiple excel files from two folder locations

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I have done it for you today.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-05-2021
    Location
    Manchester
    MS-Off Ver
    365
    Posts
    2

    Re: Merge multiple excel files from two folder locations

    Hi Ali,

    Thanks for your help - I've cracked it! Time spent away from the screen can help!!!

    The Macro was under a Module, so when the first Macro had activated, this had brought in 5 new sheets, so the cell reference (C6) wasn't defined. So have included this macro under the specific sheet where file paths are defined!!!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,401

    Re: Merge multiple excel files from two folder locations

    Thanks for letting us know.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. [SOLVED] VBA Macro to Merge multiple files in a folder
    By Devendra.dvm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2017, 11:59 PM
  2. Folder Details from Multiple Locations
    By mvinay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2017, 10:19 PM
  3. Replies: 3
    Last Post: 10-04-2016, 08:19 AM
  4. [SOLVED] How to merge multiple excel files(xls) in one folder into a new xls file.
    By Hayk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 11:48 AM
  5. Import and merge all csv files in a folder to excel worksheet delimited only by a comma
    By tomaszevsky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2012, 01:51 AM
  6. Replies: 1
    Last Post: 02-29-2012, 01:15 PM
  7. How to merge multiple excel files..?
    By clone000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2010, 05:51 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