+ Reply to Thread
Results 1 to 2 of 2

Macro append excel files

Hybrid View

  1. #1
    Registered User
    Join Date
    06-09-2016
    Location
    Paris
    MS-Off Ver
    2011
    Posts
    52

    Unhappy Macro append excel files

    hello everybody,
    I got 50 excel charts, each one with 10.000 lines and same variables, that i need to append. I would love to do it automatically. I'm on mac or PC, and i tried several macros i found on internet but no one worked. One of them is this one:
    Sub simpleXlsMerger()
    Dim bookList As Workbook
    Dim mergeObj As Object, dirObj As Object, filesObj As Object, everyObj As Object
    Application.ScreenUpdating = False
    Set mergeObj = CreateObject("Scripting.FileSystemObject")
     
    'change folder path of excel files here
    Set dirObj = mergeObj.Getfolder("D:\change\to\excel\files\path\here")
    Set filesObj = dirObj.Files
    For Each everyObj In filesObj
        Set bookList = Workbooks.Open(everyObj)
     
        'change "A2" with cell reference of start point for every files here
        'for example "B3:IV" to merge all files start from columns B and rows 3 
        'If you're files using more than IV column, change it to the latest column
        'Also change "A" column on "A65536" to the same column as start point
        Range("A2:IV" & Range("A65536").End(xlUp).Row).Copy
        ThisWorkbook.Worksheets(1).Activate
     
        'Do not change the following column. It's not the same column as above
        Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
        Application.CutCopyMode = False
        bookList.Close
    Next
    End Sub
    How can I do ? DO you know what is the problem in this macro ? or is there an other one ?

    thank you very much
    Last edited by JBeaucaire; 06-12-2016 at 01:35 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro append excel files

    It would be simpler if you SHOW us the problem in a workbook.

    Attach a sample workbook. Make sure there is just enough chart data to demonstrate your need using BEFORE sheet and an AFTER sheet if needed to show the update you're trying to complete or automate.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window (or use the paperclip icon).
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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. Append Multiple XML Files to a table in Excel
    By pritchard.ev in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2016, 07:28 AM
  2. Macro to append excel files
    By shanky2704 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2014, 04:07 PM
  3. Append data from multiple excel files with respective file name
    By vijay20cbe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2014, 12:07 PM
  4. [SOLVED] Import data from excel files to append master file
    By kdawgpl9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2013, 04:32 PM
  5. Run macro on many csv files and append only one row into master excel file
    By Novice123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2012, 09:45 AM
  6. Extract Columns from Excel Files then Append to .CSV file
    By r0mmel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2011, 05:06 AM
  7. Append Text Files in Excel
    By vijay2482 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-23-2009, 10:06 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