Hi,
I'm attempting to write a macro that will circle a student result and then print their report. The report displays each possible result from A to E but only has the actual student result circled.
I've based this around three worksheets; on the first I have circled the letters A to E in five cells for copying; on the second I will have the student report that ends up being printed and shows the student grade circled; the third is just a list of student names and their result.
My attempt is inefficient and I'm not sure how to make it go through each student name. This is the macro so far:
Sub Macro1()
'
' Macro1 Macro
'
Sheet2.Ovals.Delete
Sheet2.Range("A1").Value = "A"
Sheet2.Range("B1").Value = "B"
Sheet2.Range("C1").Value = "C"
Sheet2.Range("D1").Value = "D"
Sheet2.Range("E1").Value = "E"
If Sheet3.Range("B2") = "A" Then
Sheets("Sheet1").Select
Sheet1.Range("F1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("A1").Select
ActiveSheet.Paste
End If
If Sheet3.Range("B2") = "B" Then
Sheets("Sheet1").Select
Sheet1.Range("G1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("B1").Select
ActiveSheet.Paste
End If
If Sheet3.Range("B2") = "C" Then
Sheets("Sheet1").Select
Sheet1.Range("H1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("C1").Select
ActiveSheet.Paste
End If
If Sheet3.Range("B2") = "D" Then
Sheets("Sheet1").Select
Sheet1.Range("I1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("D1").Select
ActiveSheet.Paste
End If
If Sheet3.Range("B2") = "E" Then
Sheets("Sheet1").Select
Sheet1.Range("J1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("E1").Select
ActiveSheet.Paste
End If
End Sub
It would be great if someone could give me some advice on this. Thank you.
I'm attempting to write a macro that will circle a student result and then print their report. The report displays each possible result from A to E but only has the actual student result circled.
I've based this around three worksheets; on the first I have circled the letters A to E in five cells for copying; on the second I will have the student report that ends up being printed and shows the student grade circled; the third is just a list of student names and their result.
My attempt is inefficient and I'm not sure how to make it go through each student name. This is the macro so far:
Sub Macro1()
'
' Macro1 Macro
'
Sheet2.Ovals.Delete
Sheet2.Range("A1").Value = "A"
Sheet2.Range("B1").Value = "B"
Sheet2.Range("C1").Value = "C"
Sheet2.Range("D1").Value = "D"
Sheet2.Range("E1").Value = "E"
If Sheet3.Range("B2") = "A" Then
Sheets("Sheet1").Select
Sheet1.Range("F1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("A1").Select
ActiveSheet.Paste
End If
If Sheet3.Range("B2") = "B" Then
Sheets("Sheet1").Select
Sheet1.Range("G1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("B1").Select
ActiveSheet.Paste
End If
If Sheet3.Range("B2") = "C" Then
Sheets("Sheet1").Select
Sheet1.Range("H1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("C1").Select
ActiveSheet.Paste
End If
If Sheet3.Range("B2") = "D" Then
Sheets("Sheet1").Select
Sheet1.Range("I1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("D1").Select
ActiveSheet.Paste
End If
If Sheet3.Range("B2") = "E" Then
Sheets("Sheet1").Select
Sheet1.Range("J1").Select
Selection.Copy
Sheets("Sheet2").Select
Sheet2.Range("E1").Select
ActiveSheet.Paste
End If
End Sub
It would be great if someone could give me some advice on this. Thank you.