+ Reply to Thread
Results 1 to 11 of 11

copy from one sheet and paste in another sheet

  1. #1
    Registered User
    Join Date
    03-19-2009
    Location
    tampa,fl
    MS-Off Ver
    Excel 2003
    Posts
    14

    copy from one sheet and paste in another sheet

    I need to write a simple macro to copy the last row in a spreadsheet and paste it as a new row in the other sheet.

    Please help.

    Thanx in advance.
    Last edited by VBA Noob; 03-19-2009 at 05:42 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: macro help

    Please take a few minutes to read the Forum Rules about thread titles, and then edit yours to make it descriptive of your problem.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: copy from one sheet and paste in another sheet

    Thank you. Try this:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-19-2009
    Location
    tampa,fl
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: copy from one sheet and paste in another sheet

    Thanx for responding.

    This code does copy from sheet 1 to sheet 2.
    But i want to copy the last row as in the latest row from sheet1 and paste it in the sheet 2 as a new row.

    Can i call LASTINROW function.
    if so how can i incorporate it in the code.
    I am new to writing macros.... so need help.
    Last edited by swe1; 03-19-2009 at 03:36 PM.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: copy from one sheet and paste in another sheet

    But i want to copy the last row as in the latest row from sheet1 and paste it in the sheet 2 as a new row.
    The code copies the row containing the last used cell in Sheet1 column A to the row below the last used cell in Sheet2 column A. If you need something different, please explain clearly.
    Can i call LASTINROW function.
    Pardon?

  6. #6
    Registered User
    Join Date
    03-19-2009
    Location
    tampa,fl
    MS-Off Ver
    Excel 2003
    Posts
    14

    Unhappy Re: copy from one sheet and paste in another sheet

    Hi,

    Thanks SHG!
    Your code works but with an error 1004.

    I tried the following code.It seems to be working but still have problems while pasting the row.
    Note:I tried working between the sheets in the same workbook.
    Please help.Any help would be appreciated.
    Thanks!

    Here is my code.


    Please Login or Register  to view this content.
    Last edited by swe1; 03-21-2009 at 08:53 PM.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: copy from one sheet and paste in another sheet

    Please edit your post to add code tags.

  8. #8
    Registered User
    Join Date
    03-19-2009
    Location
    tampa,fl
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: copy from one sheet and paste in another sheet

    Hi Shg,

    I did add code Tags.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: copy from one sheet and paste in another sheet

    I don't see what the problem is. Please post a workbook and explain in context.

  10. #10
    Registered User
    Join Date
    03-19-2009
    Location
    tampa,fl
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: copy from one sheet and paste in another sheet

    Hello Shg,

    I have attached my workbook.
    I get the runtime error 1004
    at the following code
    Rows(Emptycell.select)
    Attached Files Attached Files

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: copy from one sheet and paste in another sheet

    Replace all of your code with this:
    Please Login or Register  to view this content.

+ 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