+ Reply to Thread
Results 1 to 8 of 8

Loop through worksheets to copy data to new workbook

  1. #1
    Registered User
    Join Date
    09-13-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Loop through worksheets to copy data to new workbook

    I have a workbook which has many sheets with the same format like below (Under header 4 some rows are blank):

    Capture.PNG

    What I want to do is to loop through the worksheets and copy the data under header 4 and header 6 to a new worksheet which looks like:

    Capture2.PNG

    a sample is attached. Sample Data.xlsx
    I have put the final format in the "to look like" worksheet to illustrate the final layout.
    Really appreciate if someone could help with this!!
    Last edited by livelyzd; 10-23-2013 at 03:54 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Loop through worksheets to copy data to new workbook

    Try the below code…

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Loop through worksheets to copy data to new workbook

    Another option
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-13-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Loop through worksheets to copy data to new workbook

    Hi AB33 thanks for the reply! but I tried your macro it did not work...gave me a blank new "master sheet"
    I am not sure why because it worked in your sample file.
    So I attached my original file for your reference Raw Format.xlsm
    This is the exact file format I am working with except I removed the confidential data.
    What I want is as described in the post. Thanks!

  5. #5
    Registered User
    Join Date
    09-13-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Loop through worksheets to copy data to new workbook

    Hi SixthSense thanks for the reply! but I tried your macro it did not work...gave me a run time error 424
    I am not sure why because it worked in your sample file.
    So I attached my original file for your reference Raw Format.xlsm
    This is the exact file format I am working with except I removed the confidential data.
    What I want is as described in the post. Thanks!

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Loop through worksheets to copy data to new workbook

    Try this slightly adjusted code….

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-13-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Loop through worksheets to copy data to new workbook

    Hi SixthSense works like a charm! Thank you so much!!

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Loop through worksheets to copy data to new workbook

    Glad it helps you and thanks for the feedback and rep

+ 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. Replies: 0
    Last Post: 07-02-2013, 07:49 AM
  2. Copy/Paste Range of Data from Multiple Workbooks/Worksheets to Master Workbook/Worksheets
    By NumberCruncher311 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-19-2013, 08:21 PM
  3. Loop through range and copy to new workbook as seperate worksheets
    By thesasman2012 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2012, 10:25 AM
  4. Loop command macro to copy data between worksheets
    By ThunderBuck in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-12-2009, 11:55 AM
  5. Replies: 1
    Last Post: 04-01-2006, 03:50 PM

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