I'm trying to copy entire rows of the Sheet ‘All’ to another sheet according to the data in column D. There are multiple values in column D (Homework/Advanced/Beginner) and the sheets these rows need to be copied to have corresponding names. (Homework to Homework sheet.)
The data in Sheet ‘All’ will be added on to and the new data needs to be copied without duplicating the ones that are already there.
It's not a big problem. The best thing is to keep things simple and copy everything whenever "all" changes. I'd have a "Redistribute" button on the "all" sheet and have the event call scatterRows()
You don't say what your source sheet looks like so I made something up for sheet "all":
The code is fairly flexible; it finds the whole source block, so it doesn't matter how many columns you have as long as column "D" holds the sheet key and the data starts in A1 (no headings). If you have headings, change all the A1 references to A2.
The other sheets ("homework" etc) must have been created. --And you need a reference set to the Microsoft Scripting Runtime.
The only "interesting" part of the code is figuring out the string for the target range (putString).