+ Reply to Thread
Results 1 to 4 of 4

Collating data from multiple workbook

  1. #1
    Registered User
    Join Date
    12-22-2013
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    47

    Collating data from multiple workbook

    Hi Friends,

    I have a file named as "consolidator", in which data is being collected from multiple files (without opening them)(in this example it pulls data from files B1 and B2; placed in the same folder where consolidator file is placed. This tool works fine when the number of columns to be pulled is less than 20, but when i make changes in the code to pull more than 20 columns of data, then it gives run-time error '1004'.

    This error is coming from the line
    Please Login or Register  to view this content.
    code line which pulls 20 columns of data without error is
    Please Login or Register  to view this content.
    Code line which gives error when i try to pull 100 columns of data
    Please Login or Register  to view this content.
    I have attached all the three files for easy understanding. In the attached file code is for pulling 20 columns of data. Please suggest what changes i should make in the code to pull 100 columns of data present in files B1 and B2.

    B1.xlsxConsolidator.xlsB2.xlsx

    Thanks friends

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,392

    Re: Collating data from multiple workbook

    Hi there,

    The problem occurs when the data column changes from Column Z to Column AA, so using Chr(G + 64) to identify the column is not appropriate from that point onwards.

    To overcome the problem in the easiest way you should change from A1 cell references to R1C1 cell references, i.e. use the following code:

    Please Login or Register  to view this content.
    instead of the existing code:


    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    12-22-2013
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Collating data from multiple workbook

    Thanks a lot Greg M .

    I was thinking that something is wrong with 64 number in the code.
    Thanks for correcting the code and the description about it.
    Its working absolutely fine now.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,392

    Re: Collating data from multiple workbook

    Hi again,

    Many thanks for your very prompt feedback - glad I was able to help.

    Best regards,

    Greg M

+ 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] Collating data from multiple sheets
    By cjharwood in forum Excel General
    Replies: 9
    Last Post: 07-22-2015, 02:16 AM
  2. [SOLVED] Collating data from multiple sheets
    By darrylfunky in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-08-2014, 07:32 PM
  3. Collating Data from multiple Pages
    By Hawkins1989 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2014, 09:52 AM
  4. Collating Data From Multiple Columns (Detailed!)
    By dd-ef in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2013, 03:54 PM
  5. Collating data from multiple sheets
    By 1.zer0 in forum Excel General
    Replies: 0
    Last Post: 05-17-2011, 11:21 AM
  6. Replies: 2
    Last Post: 10-20-2010, 08:52 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