danielemusu
New Member
- Joined
- Jun 20, 2022
- Messages
- 1
- Office Version
- 365
- Platform
- MacOS
I need help. I need to write a VBA code where I need to match an ID number from the answer sheet to each student submission ( open each student submission separate) once that's done I need to grade it and assign a grade. IF IDs match ( student to answer sheet) then it's a point, if they don't it's no point and if the student has a duplicate ID on their submission it's half a point.
When that's done all the duplicates need to get moved to a sheet called Review records sheet and all full point move to the grade sheet. ANy help please as this is what I have and does not run
When that's done all the duplicates need to get moved to a sheet called Review records sheet and all full point move to the grade sheet. ANy help please as this is what I have and does not run
VBA Code:
Dim i As Integer
Dim Grade As Double
Dim GradePoint As Long
Dim ID As Integer
Dim counter As Integer
Dim FinalGrade As Integer
'Find and Open Reviewed Records File
' user selected a file - do something
userSelectedFile = Application.GetOpenFilename
If userSelectedFile = False Then
MsgBox "No file Selected."
Else
' user selected a file - do something
MsgBox "File selected: " & userSelectedFile
Set wbNew = Workbooks.Open(userSelectedFile)
End If
'Find and Open Reviewed Records File
' user selected a file - do something
userSelectedFile = Application.GetOpenFilename
If userSelectedFile = False Then
MsgBox "No file Selected."
Else
' user selected a file - do something
MsgBox "File selected: " & userSelectedFile
Set wbNew = Workbooks.Open(userSelectedFile)
End If
For counter = 1 To 1000
FinalGrade = FinalGrade + 1
If counter > 0 Then
FinalGrade = FinalGrade + 0.5
Else
If counter <> 0 Then
FinalGrade = FinalGrade + 0
Else
If counter = 0 Then
FinalGrade = FinalGrade + 1
Else
End If
Do
For Each ID In Collection
If counter > 0 Then
FinalGrade = FinalGrade + 0.5
ID = ReviewedRecordsSheet
Else
If counter = 0 Then
FinalGrade = FinalGrade + 1
ID = GradeFileSheet
Loop Until ID = GradeFile