Hi Guys
I have been trying to experiment with copying files from a closed workbook. I am particularly interested in copying and pasting using the destination method where I don't need to copy and paste as values. I want to understand how the command works but I don't really know. My knowledge of VBA is cobbled together from copying other code and figuring out what each line of code does in relation to the spreadsheets. That is all well and good until I want to understand how a code works properly then I have to try and research and find out and when I fail to understand I am going to come here and ask in the hope someone can enlighten me. So far I have the code working in some capacity.
I have attached 2 files one named original with my original code which works well and the new extraction with the new code which doesn't work so well as it leaves me with #N/A in all of the rows below the first lot of data that it manages to extract.
It won't let me post the code in here which is the second time I have not been able to post code in the forums due to the security features of this site.
ORIGINAL DATA EXTRACTION.xlsm
NEW DATA EXTRACTION.xlsm
My lack of understanding of where to put lngrow means I am unsure how to incorporate it into this. I want the first 80 rows of data to fill up then follow on with the next 80 rows of data below it from the next closed workbook. I am unsure of how to do this with this particular command. I am really just trying to learn how to use VBA as efficiently as possible. I know there is many ways to doing things but I want to have code that executes quickly and effectively and whilst copy and paste values works well I understand that it is slow and cumbersome and have noticed how much faster the destination method is. Over time and experimenting with different lines of code I hope to pick up VBA enough to the point where I can write code off the top of my head without having to reference any materials ensuring what I write is the fastest possible way of performing the tasks. You don't notice how long some code takes until it has to work through many workbooks and I am learning that a few simple tweaks can make a world of difference. I would appreciate any help anyone can offer me on this
Bookmarks