+ Reply to Thread
Results 1 to 5 of 5

Copy and Paste to next empty row without overwriting.

  1. #1
    Registered User
    Join Date
    02-19-2017
    Location
    Helsinki, Finland
    MS-Off Ver
    MS Office 365
    Posts
    60

    Copy and Paste to next empty row without overwriting.

    Hello, I need help. I have 4 sheets (3 source and 1 destination), source sheets are “P Local”, “P foreign” and “P VDS”. Destination Sheet name is “Purchase Register”. I need a way to copy data from the 3 sheets without overwriting previous data. The source data is adding often and destination sheet also update often. Example: ”P Local” has 6 rows data and this data will paste to “Purchase Register”. “P Foreign” has 4 rows data, this data will paste to “Purchase Register” just after 6 rows.
    Next day, ”P Local” added 5 rows data and this data will paste to “Purchase Register” just after (6+4) 10 rows, “P Foreign” added new data 2 rows and this data will paste to “Purchase Register” just after (6+4+5) 15 rows, “P VDS” has 3 rows and this data will paste to “Purchase Register” just after 15 rows.
    I made vba code for this purpose, it always overwriting. What is wrong with my code?? I attached a file. What will be correct VBA code??
    your help is greatly appreciated as always!! thank you for your time!!!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy and Paste to next empty row without overwriting.

    Please Login or Register  to view this content.
    When you call MassCopy, you are passing the source row i twice as both the source row and destination row.


    Try something like this (not tested)
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-19-2017
    Location
    Helsinki, Finland
    MS-Off Ver
    MS Office 365
    Posts
    60

    Re: Copy and Paste to next empty row without overwriting.

    Hello,
    I used your code which you advice. It's works, but make a new problem. That is when new data added at source sheet, after that when paste to destination sheet then new data and previous data all are pasted. I need, always new data paste to destination sheet just after previous data. Thanks for your time.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy and Paste to next empty row without overwriting.

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 05-08-2021 at 07:24 AM.

  5. #5
    Registered User
    Join Date
    02-19-2017
    Location
    Helsinki, Finland
    MS-Off Ver
    MS Office 365
    Posts
    60

    Re: Copy and Paste to next empty row without overwriting.

    Hello,
    Thanks a lot. It works very nicely.

+ 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. [SOLVED] copy and paste overwriting conditional formatting
    By billyjo182 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2017, 04:06 PM
  2. Replies: 1
    Last Post: 09-29-2016, 01:44 AM
  3. Data Validation - Avoid overwriting due to copy/paste
    By amitgaja007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2015, 01:29 AM
  4. How to copy and paste data into middle of other cell without overwriting?
    By papisox in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-24-2014, 02:07 PM
  5. Copy/Paste to Next Empty Row Overwriting Previous Row When Column A Is Empty
    By grantfitz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2013, 04:34 PM
  6. copy and paste without overwriting cells containing values
    By schueyisking in forum Excel General
    Replies: 2
    Last Post: 08-14-2008, 05:43 AM
  7. copy and paste without overwriting cells containing values
    By schueyisking in forum Excel General
    Replies: 1
    Last Post: 08-14-2008, 12:26 AM

Tags for this Thread

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