Forum Discussion
Generating results...
Thanks.
Hi Sotannde,
please find attached my solution. I used Index/Match to populate Pupil's Progress Report. To enable this, I added a concatenation line in row 5 to combine area and subject, and used this concatenation as the lookup item in the formula.
I have also added a macro to loop the list of students and print Progress Reports for each student after populating it with the next student's name. Here is the text of the macro:
Sub print_all_reports()
Dim vaStudentName As Variant
Dim i As Integer
Dim rRptStudentName As Range
Set rRptStudentName = Range("rptStudentName")vaStudentName = Range("dataStudentName")
For i = LBound(vaStudentName, 1) To UBound(vaStudentName)
If Len(Trim(vaStudentName(i, 1))) Then
rRptStudentName = Trim(vaStudentName(i, 1))
With ActiveSheet
.Calculate
.PrintOut
End With
End If
Next iEnd Sub
Please be aware that the macro will send printed pages straight to your printer unless you select 'Save to pdf'.
Hope this helps
Yury
2 Replies
- Yury TokarevSteel Contributor
Hi Sotannde,
please find attached my solution. I used Index/Match to populate Pupil's Progress Report. To enable this, I added a concatenation line in row 5 to combine area and subject, and used this concatenation as the lookup item in the formula.
I have also added a macro to loop the list of students and print Progress Reports for each student after populating it with the next student's name. Here is the text of the macro:
Sub print_all_reports()
Dim vaStudentName As Variant
Dim i As Integer
Dim rRptStudentName As Range
Set rRptStudentName = Range("rptStudentName")vaStudentName = Range("dataStudentName")
For i = LBound(vaStudentName, 1) To UBound(vaStudentName)
If Len(Trim(vaStudentName(i, 1))) Then
rRptStudentName = Trim(vaStudentName(i, 1))
With ActiveSheet
.Calculate
.PrintOut
End With
End If
Next iEnd Sub
Please be aware that the macro will send printed pages straight to your printer unless you select 'Save to pdf'.
Hope this helps
Yury
- Sotannde Abiodun KabirCopper ContributorThank you very much. I'll go through it.