+ Reply to Thread
Results 1 to 9 of 9

Copy from one sheet to next empty row in another

  1. #1
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Copy from one sheet to next empty row in another

    Hi all,

    I have the following code, however there is an 'Object Required' error popping up on the 3rd row (Set rng1 = etc)

    Please Login or Register  to view this content.
    Any ideas why this is occurring? Or any ideas how to amend it/any alternatives?

    Kind Regards,

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Copy from one sheet to next empty row in another

    When/how did you assign the value to "LastRow"?
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Copy from one sheet to next empty row in another

    I've just realised that is part of my issue - I have added in
    Please Login or Register  to view this content.
    I am now getting an error on the last row of code.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy from one sheet to next empty row in another

    I note you haven't dimmed the LastRow variable - although I think that would give you a different error message than the one you describe. And although you've dimmed a rng2 you're not using that.

    That said try something like the following

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Copy from one sheet to next empty row in another

    Your code should not raise the error at "(Set rng1 = etc)", as long as you have Sheet11.
    For the safety, add a period before Rows.Count
    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Copy from one sheet to next empty row in another

    Quote Originally Posted by chrisellis250 View Post
    I've just realised that is part of my issue - I have added in
    Please Login or Register  to view this content.
    I am now getting an error on the last row of code.
    Declaring variable doesn't mean assigning value to it.

    try
    change to
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Copy from one sheet to next empty row in another

    Im getting a 'Run-time error '1004'': Method 'Range' of object'_Worksheet' failed on the following:

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Copy from one sheet to next empty row in another

    Apologies, your most recent code did the trick. Thanks guys, got a bit muddled!

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Copy from one sheet to next empty row in another

    No problem.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. Copy and Paste from one sheet to next empty table row in another sheet
    By shre0047 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2016, 01:19 AM
  2. Copy value in sheet 2 and paste in next empty cell in sheet 1
    By Locutos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2016, 03:21 PM
  3. [SOLVED] Copy From one Sheet to the Next empty cell on the next
    By John Swift in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2015, 04:29 PM
  4. [SOLVED] Problems With Macro to Copy Cells From One Sheet to Next Empty Row In Another Sheet
    By sliesneekr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-01-2014, 09:12 AM
  5. Copy Range from Sheet A then find the next empty row in sheet B
    By clowesr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-02-2014, 05:42 PM
  6. [SOLVED] Copy and Paste Row from Sheet(1) to First Empty Row in Sheet(2)
    By jgray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-21-2013, 03:54 PM
  7. Copy fields from sheet to sheet only if not empty and only on-demand
    By Powrpak in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-17-2008, 10:23 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