Copy & Paste to the next empty row/column in a new worksheet, multiple times

  • Hello - I have a worksheet with a lot of raw data scattered in various cells. But I need to organize that raw data into specific columns on another worksheet. I tried creating a macro to copy from the raw worksheet and paste into the organized worksheet, into the next empty row, but when I run the macro it replaces the data previously copied and pasted. How can I copy from the raw worksheet and paste into the organized worksheet, into the next empty row; and be able to do this multiple times?
    Here's a copy of my current code:

  • Hello and Welcome to the Forum :smile:


    You have used the macro recorder .... which is a good starting point ...


    But to improve this solution, it would be better if you could attach your file with your next message ... :wink:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Give this a try. I'll let you build out the rest.


    Note: Please fix your code tags in post #1.


    Code
    1. Sub Transfer_Data()
    2. Dim wsSrc As Worksheet: Set wsSrc = Sheets("Raw")
    3. Dim wsDest As Worksheet: Set wsDest = Sheets("SIRs")
    4. With wsDest
    5. .Range("A" & Rows.Count).End(xlUp).Offset(1) = wsSrc.Range("M18")
    6. .Range("B" & Rows.Count).End(xlUp).Offset(1) = wsSrc.Range("N26")
    7. .Range("C" & Rows.Count).End(xlUp).Offset(1) = wsSrc.Range("K13")
    8. .Range("D" & Rows.Count).End(xlUp).Offset(1) = wsSrc.Range("K14")
    9. End With
    10. End Sub
  • Thanks Carim! It worked perfectly!


    Glad to hear your problem is solved ...


    Thanks a lot for your Thanks ...AND for the Like ..:smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • [ATTACH=JSON]{"alt":"Click image for larger version Name:\tForum Code Tags.jpg Views:\t0 Size:\t12.1 KB ID:\t1224970","data-align":"none","data-attachmentid":"1224970","data-size":"full"}[/ATTACH]


    In order to insert your macro and make it clean for all readers .... Code Tags are necessary ... :wink:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)