+ Reply to Thread
Results 1 to 8 of 8

Copy column data from multple sheets and merge into another sheet

  1. #1
    Registered User
    Join Date
    07-02-2011
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    28

    Question Copy column data from multple sheets and merge into another sheet

    Hi. I have three sheets in my workbook that I want to copy a range of data from one specific column (different in each sheet) and put together in a column in another sheet in the same workbook.

    Is there an easy way to do this?

    I tried recording a macro and modifying, but keep getting errors...

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy column data from multple sheets and merge into another sheet

    as you cannot just copy the whole column 3 times (as it will copy all lines including blank), the problem you have is finding the last row of the column
    record macro will never tell you this
    here is some reading on this topic
    http://www.rondebruin.nl/win/s9/win005.htm

    i think once you know how to find the last row you would know what to do?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

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

    Re: Copy column data from multple sheets and merge into another sheet

    Maybe:

    Please Login or Register  to view this content.
    Would load the consolidation into Column("A")

  4. #4
    Registered User
    Join Date
    07-02-2011
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Copy column data from multple sheets and merge into another sheet

    Thanks John, that was just what I was after, however, I didn't state that I would like the data pasted into "Another Sheet" from cell N10 down and any blanks removed. I've given it a go myself, but I think I am just wasting my time. How would I add those conditions into the code you provided? Thanks in advance.

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

    Re: Copy column data from multple sheets and merge into another sheet

    Maybe:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-02-2011
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Copy column data from multple sheets and merge into another sheet

    Thanks again, I have amended the data to match what I am using, but when I run the macro nothing happens. I have attached the amended code, can you see anything that may be causing this?

    I am trying to copy from the sheets named "BPA - Create ü", "SPO - Create ü". The data is I want starts at N12. The copy destination is in the sheet named "PO Close" from cell F12 down.

    Cheers
    Connie

    Sub GetRecords_Click()
    Dim x As Range, ws As Worksheet, y As Long, z As Long
    z = Sheets("PO Close").Range("F" & Rows.Count).End(3).Row
    For Each ws In ActiveWorkbook.Worksheets
    Select Case ws.Name
    Case Is = "BPA - Create ü", "SPO - Create ü"
    Set x = ws.Rows(9).Find("PO Number", LookIn:=xlValues, Lookat:=xlWhole)
    If Not x Is Nothing Then
    y = ws.Cells(Rows.Count, x.column).End(3).Row
    Select Case z
    Case Is = 10
    ws.Range(Cells(2, x.column), Cells(y, x.column)).Copy Sheets("PO Close").Range("F10")
    Case Is > 10
    ws.Range(Cells(2, x.column), Cells(y, x.column)).Copy Sheets("PO Close").Range("F" & Rows.Count).End(3)(2)
    End Select
    End If
    Set x = Nothing
    End Select
    Next ws
    Sheets("PO Close").Range("F10:F" & Range("F" & Rows.Count).End(3).Row).SpecialCells(4).Delete xlUp
    End Sub

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

    Re: Copy column data from multple sheets and merge into another sheet

    Connie, please use code tags when posting too the Forum. See Forum Rule No. 3.

    Please Login or Register  to view this content.
    Currently your find row is 9.

    Please Login or Register  to view this content.
    When you say " The data is I want starts at N12." Please explain further. You don't want the same Column that "PO Number" is in?

  8. #8
    Registered User
    Join Date
    07-02-2011
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Copy column data from multple sheets and merge into another sheet

    Thanks, "PO Number" is in column N, the first cells with a value is in row 12, column N. I have headers, but they don't start until row nine, there are a few more rows that have different formatting inbetween which I don't want to include. The sheet PO Close has the heading PO Number also, so I don't need that to be included in the copy, just the data. The column that PO Header is in 'PO Close' is column F, and I trying to get it to paste from row 12 downward in that column. Thanks.
    Last edited by connieb; 07-12-2016 at 05:22 PM.

+ 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. Need to copy Sheet Name and Column Headers to new sheets for each row with data
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2015, 08:30 PM
  2. [SOLVED] Merge ranges from specific sheets by adding the sheet name as the first column
    By tabrizbalasi in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-24-2015, 01:38 PM
  3. [SOLVED] Copy rows across multple sheets
    By SPARKY347 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-03-2015, 05:47 PM
  4. Copy rows in multiple sheets given a critieria and merge them in another sheet
    By on2mars in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2014, 06:27 AM
  5. Replies: 2
    Last Post: 10-08-2013, 02:58 PM
  6. Merge first column From Multiple Sheets Into One Sheet
    By Tomboy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-21-2012, 12:05 PM
  7. Populate Summary Sheet with same cell from multple sheets
    By ShredDude in forum Excel General
    Replies: 9
    Last Post: 07-16-2007, 08:12 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