+ Reply to Thread
Results 1 to 17 of 17

Copy from Sheet1&paste in next blank row of Sheet 2

  1. #1
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Copy from Sheet1&paste in next blank row of Sheet 2

    Hello:

    I am trying to edit the following code, specifically this line:

    Range("Table3[Column1]" & Range("Table3[#All]").End(xlUp).Row + 1).Select

    I am trying to get the data range from sheet 1 to copy and paste into the row that is blank after the last entry within the table in sheet 2. Thanks

    Code Below

    Sheets("Data").Select
    Range("A3:AD15").Select
    Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    Selection.Copy
    Sheets("Consolidated Data").Select

    Range("Table3[Column1]" & Range("Table3[#All]").End(xlUp).Row + 1).Select

    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
    xlNone, SkipBlanks:=False, Transpose:=False

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    Just do
    Please Login or Register  to view this content.
    and forget the rest of the code below Selection.Copy
    Not all forums are the same - seek and you shall find

  3. #3
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    Thanks Simon:

    I tried the following but still keep getting an error:

    Sheets("Data").Select
    Range("A3:AD15").Select
    Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    Selection.Copy
    Selection.Copy Destination:=Sheets("Consolidated Data").Range("A" & Rows.Count).Offset(1, 0)

    Thanks for your help

  4. #4
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    remove the first Selection.Copy
    and change the last selection.copy line for this
    Please Login or Register  to view this content.
    Last edited by Simon Lloyd; 11-22-2011 at 04:26 PM.

  5. #5
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    The following still did not work. I am trying to paste to a table range, specifically , Table 3 in sheet 2. Would I need to include the table 3 name in the range. Thanks

    Sheets("Data").Select
    Range("A3:AD15").Select
    Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    Selection.Copy Destination:=Sheets("Consolidated Data").Range("A" & Rows.Count).Offset(1, 0)

  6. #6
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    check my edit above

  7. #7
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    It still did not work when i took out the first selection.copy. I am trying to paste to a table range, specifically , Table 3 in sheet 2. Would I need to include the table 3 name in the range. Thanks

    Sheets("Data").Select
    Range("A3:AD15").Select
    Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    Selection.Copy Destination:=Sheets("Consolidated Data").Range("A" & Rows.Count).Offset(1, 0)

  8. #8
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    I even tried the following but it did not work. Thanks

    Selection.Copy Destination:=Sheets("Consolidated Data").Range("Table3[Column 1]" & Rows.Count).Offset(1, 0)

  9. #9
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    this code works very good, just change the rows and column numbers:
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    If i have a table in sheet two, how would I add the data to the table? Thanks.

  11. #11
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    Quote Originally Posted by rlsublime View Post
    It still did not work when i took out the first selection.copy. I am trying to paste to a table range, specifically , Table 3 in sheet 2. Would I need to include the table 3 name in the range. Thanks

    Sheets("Data").Select
    Range("A3:AD15").Select
    Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    Selection.Copy Destination:=Sheets("Consolidated Data").Range("A" & Rows.Count).Offset(1, 0)
    Quote Originally Posted by rlsublime View Post
    I even tried the following but it did not work. Thanks

    Selection.Copy Destination:=Sheets("Consolidated Data").Range("Table3[Column 1]" & Rows.Count).Offset(1, 0)
    Thats probably because you didn't look at my edit as i indicated
    Please Login or Register  to view this content.
    anyway why not post a sample workbook, it would be easier

  12. #12
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    just modify B2:E range in sheet1 which is source. and modify G column in sheet2 which is destination

  13. #13
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    Here is the file Simon. I am trying to add the data in sheet1 to the table in sheet2 so that the pivot in sheet 3 will be autoupdated.

    Thanks a lot
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    go here and add to his reputation
    http://www.excelforum.com/excel-prog...ode-error.html

  15. #15
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    use this code for your case:
    Please Login or Register  to view this content.

  16. #16
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    In your example this should work
    Please Login or Register  to view this content.
    What you have to remember is that a table (or list as you have it) isn't empty even though it appears to have no content.

  17. #17
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: Copy from Sheet1&paste in next blank row of Sheet 2

    the code you provided just pasted all the data under the table in sheet 2. It still did not paste inside the table.

+ 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