+ Reply to Thread
Results 1 to 9 of 9

Importing Data from Multiple Worksheets starting with the Same Name

  1. #1
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Importing Data from Multiple Worksheets starting with the Same Name

    Hi,

    I've a macro in which there are various sheets namely Extract, Rule List, New, Existing.

    I generate 2 worksheets from the Extract sheet - these worksheets start with the name "Samples_xx" where xx denotes a number - the no. of filled rows in the sheet.

    All that i need is to consolidate the data found in the sheets that start with the name "Samples_xx" into a single worksheet named Master in the same workbook. The sheets "Samples_xx" both are in the same format - they contain same no. of columns.

    Here's the code:

    Please Login or Register  to view this content.

    Sarang
    Last edited by Saarang84; 08-11-2010 at 10:29 AM. Reason: Thread Solved

  2. #2
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Importing Data from Multiple Worksheets starting with the Same Name

    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

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

    Re: Importing Data from Multiple Worksheets starting with the Same Name

    Here's how I would write your macro, similar to foxguy's idea:
    Please Login or Register  to view this content.
    _________________
    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!)

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

    Re: Importing Data from Multiple Worksheets starting with the Same Name

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  5. #5
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Importing Data from Multiple Worksheets starting with the Same Name

    Hi Jerry,

    The macro works fine.. But this code does not work if there is a line break (in the sense that there is an empty row inbetween). That's the one thing i want to be taken care of... How can that be done??


    Sarang

  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: Importing Data from Multiple Worksheets starting with the Same Name

    The macro does not care about line breaks, or at least I cannot see any reason blank rows would make the macro "not work", it should still copy all the data from all the sheets to one sheet, blank rows in between included.

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

    Re: Importing Data from Multiple Worksheets starting with the Same Name

    accidental duplicate.

  8. #8
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Importing Data from Multiple Worksheets starting with the Same Name

    Final file
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Importing Data from Multiple Worksheets starting with the Same Name

    Menu maker
    Attached Files Attached Files

+ 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