+ Reply to Thread
Results 1 to 10 of 10

Using a macro to merge 35 worksheets into a single file, excluding blank lines.

  1. #1
    Registered User
    Join Date
    10-11-2010
    Location
    US
    MS-Off Ver
    NA
    Posts
    41

    Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    I have 35 files with data in 14 columns of data I want to merge into one file with a macro. The goal is to run the macro and pull any data in the 14 columns into a specified destination without any blank rows. Another way of stating it is the macro should only create a row if data exist in the subsidary file.

    Currently each subsidary file has 100 rows, but could grow to a max of 300. Thanks.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    Where would the blank rows be? In the original daa or do you mean in the new workbook?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-11-2010
    Location
    US
    MS-Off Ver
    NA
    Posts
    41

    Re: Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    The original data would have blanks considering a range of 300. Currently the data in the source file only has 100 rows of data.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  5. #5
    Registered User
    Join Date
    10-11-2010
    Location
    US
    MS-Off Ver
    NA
    Posts
    41

    Re: Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    Thank you for the input. I uploaded two subdidary files (before view) and consolidated to view the file product.

    Thank you again for your expertise.


    Attached Files Attached Files

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    Would these files be in one directory with the master file?

  7. #7
    Registered User
    Join Date
    10-11-2010
    Location
    US
    MS-Off Ver
    NA
    Posts
    41

    Re: Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    Yes. It would.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    I would suggest that you create a sub folder in the one that contains the combine workbook, then place all the data workbooks in there. This code will combine the data on of each workbook in that sub folder into the combine workbook. Finally the data is sorted to remove empty rows.

    Please Login or Register  to view this content.
    Place the code in the combine workbook

  9. #9
    Registered User
    Join Date
    10-11-2010
    Location
    US
    MS-Off Ver
    NA
    Posts
    41

    Re: Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    It worked great. Thank you.

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Using a macro to merge 35 worksheets into a single file, excluding blank lines.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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