Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Below3_Click()
- End Sub
- Private Sub cb1_Click()
- Dim lastRow As Integer
- lastRow = Cells(Rows.count, 1).End(xlUp).Row
- Sheets.Add(Before:=Sheets("Sheet0")).Name = "Protocol"
- CopyData
- InsertColumns
- FormatHeaders (lastRow)
- PracticalAndThereticalPoints (lastRow)
- Dim percentPractical, percentTheoretical As Integer
- percentPractical = practicalExamTB.value
- percentTheoretical = theoreticalExamTB.value
- CoursePoints lastRow, percentPractical, percentTheoretical
- Dim pointsFor5, pointsFor3 As Integer
- pointsFor5 = pointsFor5TB.value
- pointsFor3 = pointsFor3TB.value
- Grade lastRow, pointsFor5, pointsFor3
- Range("G2") = "=SUM(C2:C" & lastRow & ")"
- Range("H2") = "=COUNTA(C2:C" & lastRow & ")"
- Range("I2") = Range("G2").value / Range("H2").value
- Range("I3") = Range("H2") / lastRow * 100
- Range("H4") = GetPoorGrade(lastRow)
- Range("H5") = GetExcelentGrade(lastRow)
- Range("I4") = Range("H4") / Range("H2") * 100
- Range("I5") = Range("H5") / Range("H2") * 100
- CourseP.Caption = lastRow - 1
- Miss.Caption = Range("I3").value
- GPA.Caption = Range("I2").value
- Below3.Caption = Range("I4").value
- Above5.Caption = Range("I5").value
- End Sub
- Function GetPoorGrade(lastRow As Integer)
- Dim countPoor As Integer
- For i = 1 To lastRow
- If Range("C" & i) <= 3 And Range("C" & i) <> "" Then
- countPoor = countPoor + 1
- End If
- Next
- GetPoorGrade = countPoor
- End Function
- Function GetExcelentGrade(lastRow As Integer)
- Dim count As Integer
- For i = 1 To lastRow
- If Range("C" & i) >= 5 Then
- count = count + 1
- End If
- Next
- GetExcelentGrade = count
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement