VB Copy Selected Range & Paste In First Blank Row

  • Hi, I wonder whether someone could help me please.


    I'm using the code below to select a range to copy from a 'Source' sheet to the next blank row on the 'Destination' sheet.



    Although the code runs without an error message being created, the data is paste at the top of the 'Destination' sheet, overwriting the existing data, instead of pasting it to the next blank row.


    I've spent all day on this and read and tried multiple examples and tutorials without success.


    I just wondered whether someone may be able to look at this please and let me know where I've gone wrong.


    Many thanks and kind regards

  • Re: VB Copy Selected Range & Paste In First Blank Row


    Does this formulation work?

    Code
    Set destRng = .Range("B" & .Rows.Count).End(xlUp)(2)

    I can't see anything wrong with your code though.

  • Re: VB Copy Selected Range & Paste In First Blank Row


    Hi StephenR, thank you for taking the time to come back to me with this.


    I've tried this, and after correcting an error I had made, the code works great.


    All the best and kind regards


    Chris

  • Re: VB Copy Selected Range & Paste In First Blank Row


    I was using B as the column to reference the last used row, when it should have been column C.


    Kind Regards


    Chris

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!