+ Reply to Thread
Results 1 to 3 of 3

Combining multiple worksheets (tabs) into one tab/worksheet

Hybrid View

  1. #1
    Registered User
    Join Date
    02-22-2009
    Location
    MORRISTOWN, NJ
    MS-Off Ver
    MICROSOFT 365
    Posts
    60

    Combining multiple worksheets (tabs) into one tab/worksheet

    Hi,

    I have a worksheet that has approximately 114 tabs of which I want to create ONE master worksheet consisting of only 1 tab.

    I have no clue how to program "code" to do this, and personally just want a quick fix to doing this because I don't know what I'm doing.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Combining multiple worksheets (tabs) into one tab/worksheet

    Buy me a dinner next time when you see me.

    Sub CombineSheets()
    Dim ws As Worksheet, wsMaster As Worksheet
    
    Set wsMaster = Worksheets("Master")
    For Each ws In ThisWorkbook.Worksheets
        If ws.Name <> "Master" Then
            ws.Cells(1, 1).CurrentRegion.Copy _
            wsMaster.Cells(wsMaster.Cells(Rows.Count, 1).End(xlUp).Row, 1)
        End If
    Next ws
    End Sub

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007/2010
    Posts
    86

    Re: Combining multiple worksheets (tabs) into one tab/worksheet

    A rather lengthy one. Will delete all your sheets.
    Sub test()
    Dim mws As Worksheet
    Dim ws As Worksheet
    Dim lrow As Long
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    Set mws = Sheets("Table 1")
    lrow = mws.Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
    For Each ws In ThisWorkbook.Worksheets
        If ws.Name <> mws.Name Then
            Range(ws.Cells(2, 1), ws.Cells(Rows.Count, 1).End(xlUp). _
            Offset(, 7)).Copy mws.Cells(lrow, 1)
            lrow = mws.Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
            ws.Delete
        End If
    Next
    mws.Cells.RowHeight = 11
    mws.Name = "Master Table"
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    End Sub
    Boon

+ 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