+ Reply to Thread
Results 1 to 5 of 5

Combine multiple sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    07-25-2017
    Location
    Texas
    MS-Off Ver
    2013 & 2016
    Posts
    12

    Combine multiple sheets

    Hi all,

    I found this vba script which is used to combine the data of multiple worksheets into one master sheet. However, I just want to copy data from row 4 downward. Please help me to achieve this. Thank you and please see below for the script :

     Sub Combine()
    Dim J As Integer
    On Error Resume Next
    Sheets(1).Select
    Worksheets.Add
    Sheets(1).Name = "Combined"
    Sheets(2).Activate
    Range("A1").EntireRow.Select
    Selection.Copy Destination:=Sheets(1).Range("A1")
    For J = 2 To Sheets.Count
    Sheets(J).Activate
    Range("A1").Select
    Selection.CurrentRegion.Select
    Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select
    Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
    Next
    End Sub
    Last edited by alansidman; 06-19-2019 at 11:16 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Combine multiple sheets

    Sub Combine()
        Dim j As Integer
        Worksheets.Add Before:=Sheets(1)
        Sheets(1).Name = "Combined"
        Sheets(2).Range("A1").EntireRow.Copy Destination:=Sheets(1).Range("A1")
        For j = 2 To Sheets.Count
            With Sheets(j)
                If .Range("A4") <> Empty Then
                    .Range("A4", .Range("A" & Rows.Count).End(xlUp)).EntireRow.Copy _
                         Destination:=Sheets(1).Range("A" & Rows.Count).End(xlUp)(2)
                End If
            End With
        Next
    End Sub
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    07-25-2017
    Location
    Texas
    MS-Off Ver
    2013 & 2016
    Posts
    12

    Re: Combine multiple sheets

    Awesome. Thanks a lot !

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,720

    Re: Combine multiple sheets

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    07-25-2017
    Location
    Texas
    MS-Off Ver
    2013 & 2016
    Posts
    12

    Re: Combine multiple sheets

    Quote Originally Posted by alansidman View Post
    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Noted. Thank you for letting me know.

+ 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. Macro to combine multiple sheets from multiple workbooks
    By snikrs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2018, 02:08 PM
  2. 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
  3. 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
  4. Combine multiple sheets of multiple workbooks in one sheet
    By Djibril69 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2013, 05:18 PM
  5. [SOLVED] align or combine multiple columns from multiple sheets into one sheet in sequence
    By calif in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-28-2013, 11:49 AM
  6. Combine multiple sheets
    By sanam in forum Excel General
    Replies: 5
    Last Post: 03-03-2009, 01:12 AM
  7. Combine multiple sheets into one
    By stonyt10 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-29-2008, 02:56 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