+ Reply to Thread
Results 1 to 4 of 4

Copy Range from Worksheet 2, Paste to Next Empty Row Worksheet 1

  1. #1
    Registered User
    Join Date
    08-05-2009
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2003
    Posts
    61

    Copy Range from Worksheet 2, Paste to Next Empty Row Worksheet 1

    I know this has been covered extensively already, but I've gone through about 10 threads on the subject trying to glean enough to modify my code below without success. I'm hoping that while I continue to search and experiment, a helpful member might give some clue as to what I'm doing wrong.

    Here is my code:
    Please Login or Register  to view this content.
    As you can see from the above code, I've got a worksheet called "NewRow" with some formatting and formulas in row 1, from A1 to BB1. It's basically a template. I try to copy this template when someone clicks the "New Record" button, then paste it to the next available row on my records sheet.

    Column B is the only column that MUST be filled, so I'm using it to determine the last row. I'm getting a object doesn't support this property or method error on the following line;
    Sheets("Records").Range("A" & nextRow).Paste
    Regards,
    AM
    Last edited by oOarthurOo; 07-21-2010 at 04:32 PM.

  2. #2
    Registered User
    Join Date
    08-05-2009
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Copy Range from Worksheet 2, Paste to Next Empty Row Worksheet 1

    Here's another attempt, it fails as well. I've read that this is more efficient method than copy paste since it bypasses the clipboard.
    Please Login or Register  to view this content.
    This line is highlighted in the debugger:
    Sheets("NewRow").Range("A1:BB1").Copy Destination:=Sheets("Records").Range(nextRow)

  3. #3
    Registered User
    Join Date
    08-05-2009
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Copy Range from Worksheet 2, Paste to Next Empty Row Worksheet 1

    And just for completeness sake, here is yet another method that I fail to get to work properly: I've used the with statement here, because again I've read it's a more efficient way to do this.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-05-2009
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Copy Range from Worksheet 2, Paste to Next Empty Row Worksheet 1

    Finally got it! At least, finally found an answer on these forums that didn't require too much modification and could work for me.

    Please Login or Register  to view this content.
    Here's the thread that helped:

    http://www.excelforum.com/excel-gene...empty-row.html
    Last edited by oOarthurOo; 07-21-2010 at 04:32 PM.

+ 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