+ Reply to Thread
Results 1 to 4 of 4

need help writing macro to merge two files

  1. #1
    Registered User
    Join Date
    05-14-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    2

    need help writing macro to merge two files

    I have two files one a larger report Sample Charges and Sample Dispute that I need to merge with each other. I need only two columns from dispute file( Minutes Used MSG/KB/Min/MB Used) merged with the charges file.
    Any help is appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,605

    Re: need help writing macro to merge two files

    Maybe this add in will help

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: need help writing macro to merge two files

    Hello there,

    Below is a code that will add the B and C columns from the Dispute workbook into columns R and S of the Charges workbook.

    To insert this code go to the developer tab on the Excel menu. If you do not have it go to File --> Options --> Customize Ribbon --> and then in the far right column select the Developer option and select Okay.

    Next select the Macros option. In the Macro Name: text box provided type macro1 and then select Create

    Paste the below code in between the Sub and End Sub that appears.

    Please Login or Register  to view this content.
    As stated in green above you will need to change the file path in the code to the filepath you have the document saved on your computer.

    You're final code should look like this

    Please Login or Register  to view this content.
    Let me know if you have any questions!

    Finally close VBA and then go back to macros and select macro1 and click Run.

    Thanks!

    rVASQUEZ

  4. #4
    Registered User
    Join Date
    05-14-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: need help writing macro to merge two files

    thank you so much! that worked like a charm! i can now avoid tedious manual merges!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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