# Access/Excel question--generating separate sheets  with info for different courses

**URL:** <https://boards.straightdope.com/t/access-excel-question-generating-separate-sheets-with-info-for-different-courses/695635>\
**Category:** Factual Questions\
**Created:** [August 15, 2014, 7:37pm UTC](https://boards.straightdope.com/t/access-excel-question-generating-separate-sheets-with-info-for-different-courses/695635 "2014-08-15T19:37:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [August 15, 2014, 7:37pm UTC](https://boards.straightdope.com/t/access-excel-question-generating-separate-sheets-with-info-for-different-courses/695635/1 "2014-08-15T19:37:54Z")

</div>

Say I’ve got an excel spreadsheet that looks like this:

```auto

Name |Course
A |1
B |3
C |3
A |2
C |2

```

i.e. different students (who I’m calling A, B and C) associated with different courses (which I’m number 1, 2 and 3).

What I would like to accomplish is to generate a separate document for each course, listing just which students are associated with that course.

The actual list is much longer than the above of course.

Mail merge using Word with Excel doesn’t quite seem to do the trick–since it will generate a separate document for each _row_. I just want a separate document for each course.

Excel methods for this are escaping me (probably because I don’t know that much about Excel). I suspect this is something Access can do, but know even less about Access.

Is there any hope for this?

---

<div class="post-metadata">

**Author:** ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)\
**Post date:** [August 15, 2014, 8:02pm UTC](https://boards.straightdope.com/t/access-excel-question-generating-separate-sheets-with-info-for-different-courses/695635/2 "2014-08-15T20:02:44Z")

</div>

One simple way is to use pivot tables (the answer to surprisingly many questions). Create a pivot table using “Course” as the first row label and “Name” as the second. This will produce a pivot table showing each course with the list of names associated with it.

If you want each course on a separate worksheet, copy this pivot table into enough sheets to cover the number of courses you have, then in each, filter the course to show just the one you want.

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [August 15, 2014, 8:34pm UTC](https://boards.straightdope.com/t/access-excel-question-generating-separate-sheets-with-info-for-different-courses/695635/3 "2014-08-15T20:34:19Z")

</div>

Thanks, I made that work.

---

<div class="post-metadata">

**Author:** ![TroutMan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/troutman/32/6721_2.png) [@TroutMan](https://boards.straightdope.com/u/TroutMan)\
**Post date:** [August 15, 2014, 10:06pm UTC](https://boards.straightdope.com/t/access-excel-question-generating-separate-sheets-with-info-for-different-courses/695635/4 "2014-08-15T22:06:51Z")

</div>

If you simply want to print each course separately, you can do it with a single pivot table. In the pivot table designer, edit the Field Properties for the Course field and check the box for “Insert page break after each item” on the Layout & Print tab.
