Databases Reference
In-Depth Information
Workbooks("SampleReport.xls").Worksheets("Analysis").Cells(3, 2)
= GradeMethod2
Workbooks("SampleReport.xls").Worksheets("Analysis").Cells(4,
2) = GradeMethod3
'Determine Grading Distribution
For ii = 12 To LastRow("SampleReport.xls", "ClassGrades")
Select Case
Workbooks("SampleReport.xls").Worksheets("ClassGrades").Cells
(ii, 16)
Case Val(frm6Grades.TextBox_AL) To 100
GradeA = GradeA + 1
Case Val(frm6Grades.TextBox_BL) To
Val(frm6Grades.TextBox_BH)
GradeB = GradeB + 1
Case Val(frm6Grades.TextBox_CL) To
Val(frm6Grades.TextBox_CH)
GradeC = GradeC + 1
Case 0 To Val(frm6Grades.TextBox_FH)
GradeF = GradeF + 1
End Select
Next ii
'Write Results to Analysis Worksheet
Workbooks("SampleReport.xls").Worksheets("Analysis").Cells(11, 2)
= GradeA
Workbooks("SampleReport.xls").Worksheets("Analysis").Cells(12, 2)
= GradeB
Workbooks("SampleReport.xls").Worksheets("Analysis").Cells(13, 2)
= GradeC
Workbooks("SampleReport.xls").Worksheets("Analysis").Cells(14, 2)
= GradeF
'Hide the form
frm6Grades.Hide
Exit Sub
Catch_Error:
MsgBox "You must first open the file SampleReport.xls prior
to macro Execution!", _
vbOKCancel + vbCritical, "Macro Terminating"
End
End Sub
6.6
BASIC FORMATTING TECHNIQUES
When creating reports, there are some tasks that present themselves time and time again. It will
be beneficial to the reader to have a tool kit of VBA routines to accomplish these tasks for the
construction of their own specialized reports.
Search WWH ::




Custom Search