Hey everyone
I have been googling and trying to piece together as much as I can from various other questions people have asked and am not having luck in trying to create a working solution for what i am trying to do.
Problem:
Currently i am working with a very poorly created file that is about 80mbs, because it has too many links. I want to redesign it using a macro, but i am only just learning VBA, and examples given don't help. My problem is this, I have a set of data in one worksheet with each row having a given code eg 01, 02, 03 (multiple rows can have the same code), and i need to split that data based on these codes to each pre-existing worksheet, so eg code 01 would go to Sheet01, code 03 would go to Sheet03 etc. For each code there is a specific worksheet that all the rows with that code would need to be pasted into. I would paste a new set of data on a monthly basis and sometimes there would be a set of data that does not have any lines for a given code, in my example attached its the code 02.
In my attached mock-up example I have only included 8 lines of data (unique code in row A) and 5 worksheets, however my actual file has thousands of lines of data and around 40 worksheets that the data needs to be pasted into.
I feel like because of the repetitive nature of the task the set of codes can be stored in one array, the worksheets can be stored in another array and some form of a loop could filter through the data and then copy and paste all relevant lines into each corresponding worksheet. With some error check in place for any worksheets that do not have corresponding code available.
But i just can't get that to work. any help would be appreciated.
Bookmarks