Copying data from one workbook to end of worksheet in another workbook

  • Hello,



    I'm trying to copy a fixed dimension range from one workbook to the end of a worksheet in another workbook.



    This is the code I'm using to achieve this, though it's not particularly stable. I occasionally get a UsedRange of Object _Worksheet Failed or PasteSpecial Method of Range Class Failed error.



    Is there something wrong with this code, or can someone suggest some improvements?



    Thank you.



  • Re: Copying data from one workbook to end of worksheet in another workbook


    Maybe change your last row calculation to this instead....


    Code
    LastRowFinder = wsDest.range("B" & rows.count).end(xlup).row


    Usedrange can give strange results sometimes....


    Also, unless what you are copying from (your source) contains Formula's that you want to convert into values, there is no real need to use pastespecial method. You cut just use Destination:= on the copy method.


    Note, I dont have access to Excel at the moment, so the line of code above may or may not work ;)


    Ger


    Regards,
    Ger

    _______________________________________________
    There are 10 types of people in the world. Those that understand Binary and those that dont. :P


    Why are Halloween and Christmas the same? Because Oct 31 = Dec 25... ;)

    _______________________________________________

Participate now!

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