Ok so best way to explain this, I have a spreadsheet that is produced monthly. It needs to be automated. From the report that gets shipped into excel I need to take all the data from the project number column and move it to another workbook. In this workbook are worksheets for 2012 and 2013. I need all of the projects starting 300, then 400, then 500 etc to move into the new workbook and then the 2012 projects to go into one worksheet and 2013 into another. How would I go about automating such a thing?
Thanks for any help
300873 Company Name 10/09/2012
300874 Company Name 10/09/2012
412774 Company Name 30-01-12
412972 Company Name 23-05-12
412986 Company Name 17-07-12
413001 Company Name 08/06/13
413048 Company Name 14-08-12
413049 Company Name 14-08-12
413062 Company Name 20-08-13
413068 Company Name 23-08-12
413169 Company Name 21-09-13
510003 Company Name 27-12-12
600161 Company Name 28-02-12
So with these I would want all of the projects with 2012 to go into one sheet and all the others to go into a 2013 sheet in a sperate workbook, I would also need the 300— projects to go into the spreadsheet and fill rows underneath the number 300 so this might include adding rows.
you can design a macro for this pretty easily. I’m going to give you some tools to use, give it a try, when and if there is something you’re running into come back, post your code, and ask more questions on this question you’ve already made and I’ll help you along with the code so you can learn.
First, code for Opening a file from your macro:
Something else that is useful is the ability to specifically refer to different sheets and ranges without actually have to select or go to those sheets. This code, for example, writes something specific in a specific workbook, sheet, and range without going to them
Second, Copying and Pasting:
This code copies all cells and pastes them all on another sheet, you can obviously copy and paste more specific ranges (google it if you need)
Third, Determining the Year:
If the date is in Column “C” I would just do this
Try to start putting this code together into something and get back to us on this question.
Also, in the future try to do some of the research and work on this before asking, the question is actually multiple questions and very broad, making it hard to answer. That is why someone downvoted it.
Hope this helps!