Try the attached Word document and Excel workbook. Upon opening, the document looks for the an Excel workbook named 'PupilData.xlsx' in your documents folder - so that's where you should save the sample workbook for now. That workbook is assumed to have five columns (A-E) on 'Sheet1' for each pupil:
• given name
• family name
• class
• teacher
• attendance
The workbook & worksheet names can both be changed in the macro that drives the process.
As coded, the macro updates the document from the 'PupilData.xlsx' workbook each time it is opened. That, of course means any existing selections are wiped each time. Ideally, though, you'd create a template with the code and make a minor change to it so that it updates only when a new document for a given student is created. We can address that later. Have a play and see if it does what you want.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|