Using Macro to pull data from one window to another

  • THIS IS DRIVING ME MAD!!! I have the simple code that loops through a copy and paste process that will reformat a large amount of data into the format that I need it by pulling it from one file into another that has a bunch of formulas that bring up the needed data, then the macro sorts and lists the data before moving on to the next column. I have used this multiple times now; it even ran for 5 hours and produced 25000 lines of reformatted data. But now, without changing a thing except what computer I used it on, it won't recognize the other window. The code Windows("Materials Procurement - 2019 3.14.19.xlsx").Activate is used multiple times and never had any issue, but now it is bringing up Runtime Error 9, Subscript out of range. I tried going back to the original computer and it won't work there either. If someone else can see a problem please help me.


  • One of the rules you agreed to was to enclose all code in code tags.


    To do so you need to highlight any code after pasting it in the post or reply then click the # icon.


    I have added the tags for you on this occasion, but please make sure you do so yourself in future.


    Thank you.

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.