+ Reply to Thread
Results 1 to 13 of 13

Combine multiple sheets into one sheet in the same workbook

  1. #1
    Forum Contributor
    Join Date
    08-20-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010, 2016, 2019
    Posts
    110

    Combine multiple sheets into one sheet in the same workbook

    Hi,

    I want to combine data from 38 sheets into 1 sheet, all in the same workbook named "combined" (which should be on sheet 43)

    Before those sheets, I have the following which I don't want the data off:
    - Control (sheet 1) (where I change the tab names for the whole document, also using the vba code - module 1: see below)
    - Summary (sheet 42)
    - Sizes - F (sheet 40)
    - Sizes - M (sheet 41)

    So I want the data to be taken from "sheet 2 to 39". Which all rows and coulombs are exactly the same

    I tried the below code, but it didn't work, it takes the data of everything in the workbook

    Please Login or Register  to view this content.

    MODULE 1
    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 05-20-2016 at 07:38 AM. Reason: Please use code tags when posting code

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Combine multiple sheets into one sheet in the same workbook

    Please use code tags when posting too the Forum (per Forum Rule #3). Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-20-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010, 2016, 2019
    Posts
    110

    Re: Combine multiple sheets into one sheet in the same workbook

    Hi,

    It still took the data from - Control (sheet 1), Summary (sheet 42), Sizes - F (sheet 40), Sizes - M (sheet 41)

    Please see attached sheet, On this sheet there is only 3 (ward 1,2,3) sheets, but keep in mind on the original one I have 38 (sheet 2 to 39)
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Combine multiple sheets into one sheet in the same workbook

    Sorry for the late reply. You need the Sheet names indicated in the macro.

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 05-20-2016 at 07:16 AM.

  5. #5
    Forum Contributor
    Join Date
    08-20-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010, 2016, 2019
    Posts
    110

    Re: Combine multiple sheets into one sheet in the same workbook

    Thank you, the only problem is that it is copying the header each time.

    How do you copy the header only once?

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Combine multiple sheets into one sheet in the same workbook

    Try:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-20-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010, 2016, 2019
    Posts
    110

    Re: Combine multiple sheets into one sheet in the same workbook

    Its only got the 1 heading, but the table (with the colours like your previous code) are not showing and it is not counting all the data

    I have 499 students on the separate sheets, but when it is combined, there is only 486

    Is it maybe also possible to copy the same format (colours, font, rows and coulombs) to this "combined" sheet, exactly as what the others look like?

  8. #8
    Registered User
    Join Date
    11-23-2015
    Location
    Oxford, England
    MS-Off Ver
    2010
    Posts
    54

    Re: Combine multiple sheets into one sheet in the same workbook

    Hi
    I asked a similar question a few months ago and was given the following code:-

    Please Login or Register  to view this content.
    This presupposes that there is one common word on each sheet, in my case it was Title in cell C4, which must always be in the same cell, and then the code will copy from that point down. It will ignore all sheets that do not have that word in the cell. It also presupposes that the data is always copied into Sheet1. It worked brilliantly for me (thanks to the lovely person who supplied it!).

    Can't help with the formatting, except if you format as a table and copy and paste into that it should copy the formatting down.

    Hope that helps.

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Combine multiple sheets into one sheet in the same workbook

    Try:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 05-20-2016 at 11:50 AM.

  10. #10
    Forum Contributor
    Join Date
    08-20-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010, 2016, 2019
    Posts
    110

    Re: Combine multiple sheets into one sheet in the same workbook

    Hi, Thanks, JOHN H. DAVIS, it is starting to look better for me.

    Just a few issues:

    The colours of the table are not showing, as per all other sheets

    In line 184 it uses Calibri font, instead of Century gothic

    The id numbers are showing some weird format

    Will the code change if I copy one of the sheets for the combined sheet and leave it blank and then just take the data from the rest of the sheets?

    Untitled.png

  11. #11
    Forum Contributor
    Join Date
    08-20-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010, 2016, 2019
    Posts
    110

    Re: Combine multiple sheets into one sheet in the same workbook

    Hi, ok, so I managed to sort out the font, coulomb sizes, numbers to show correctly. Using the below code.

    The only thing I am struggling with is the colours of the table

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    08-20-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010, 2016, 2019
    Posts
    110

    Re: Combine multiple sheets into one sheet in the same workbook

    Yes, I figured it out

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    08-20-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2010, 2016, 2019
    Posts
    110

    Re: Combine multiple sheets into one sheet in the same workbook

    No worries, I figured it out

    I added Sheets("Combined").ListObjects.Add(xlSrcRange, Range("B3:Y2500"), , xlYes).Name = "StudentList3456789101112131415161718192021222324252627283031"

+ 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: 10-12-2015, 10:02 AM
  2. Replies: 1
    Last Post: 09-23-2015, 01:23 AM
  3. Replies: 0
    Last Post: 09-22-2015, 10:42 AM
  4. Vba/macro to combine multiple workbooks with multiple sheets into one workbook
    By ReshayM in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-03-2015, 01:00 PM
  5. Combine multiple sheets into one sheet
    By cherryab888 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2015, 05:57 PM
  6. Excel 2007 - Combine Multiple Workbooks into one Workbook Multiple Sheets
    By mab in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2014, 02:48 PM
  7. [SOLVED] Combine multiple sheets into one sheet?
    By Blueluck in forum Excel General
    Replies: 2
    Last Post: 06-08-2005, 11:05 AM

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