+ Reply to Thread
Results 1 to 6 of 6

Collating Data into one Worksheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-16-2010
    Location
    bangalore
    MS-Off Ver
    Excel 2019
    Posts
    288

    Collating Data into one Worksheet

    I have a folder containing a number of workbooks each of which
    contains a single worksheet. I am trying to combine just one worksheet
    from each of these workbooks into one workbook preserving the information and
    formatting, without all of the workbooks having to be open.

    Currently I am collating this manually. Is there any alternative way to get it collated automatically? Please help.

    Note - Example: Workbook 1
    has 5 rows of data in 15 columns, workbook 2 has 8 rows of data in 15 columns.

  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: Collating Data into one Worksheet

    'WORKBOOKS TO 1 SHEET STACKED
    Here's a macro for collecting data from all files in a specific folder.The parts of the code that need to be edited are colored to draw your attention. But essentially this macro is designed to do this...collect the data from multiple workbooks with varying lengths of data and stack all the data into a single sheet.
    _________________
    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!)

  3. #3
    Forum Contributor
    Join Date
    10-16-2010
    Location
    bangalore
    MS-Off Ver
    Excel 2019
    Posts
    288

    Re: Collating Data into one Worksheet

    Sir, When I pasted this code I am getting an error msg " Run-time Error 9, subsicript out of range". I am not able to find why this error comes because I am beginner in VB. Could you please attach the sample sheet with this code if possible.?

    Thanks..

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Collating Data into one Worksheet

    anwitha, can you post sample workbook?
    Last edited by watersev; 12-24-2010 at 01:23 AM.

  5. #5
    Forum Contributor
    Join Date
    10-16-2010
    Location
    bangalore
    MS-Off Ver
    Excel 2019
    Posts
    288

    Re: Collating Data into one Worksheet

    Hi,

    I need to collate the workbook Sample sheet 1 and Sample shee 2 in one master sheet automatically using macro.

    Attached the sample sheet for your ref.
    Attached Files Attached Files

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

    Re: Collating Data into one Worksheet

    The macro has to be edited. The error you're getting means you didn't edit it for your computer. I colored the parts you need to correct.

    1) You need to put in the correct fPath to the folder on your computer where the files are.

    2) You need to edit the Master to the name of the sheet you're collecting this data into.

    3) Also this macro goes into that workbook.

    4) You really should not have blank rows at the top of data sheets. Consider fixing that in the future so they aren't there.

+ 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