With arrays. This reads in the headers, but only outputs the re-arranged data without the new headers. This is written to handle more than 1 person row in case you add data. Note I have corrected what I assume to be a typo where you repeat q2_s2. First instance should be q2_s1.
Option Explicit
Public Sub test()
Dim arr(), ws As Worksheet, i As Long, j As Long, r As Long, c As Long, outputArr()
Set ws = ThisWorkbook.Worksheets("Sheet5"): arr = ws.[B1:I2].Value '<=adjust if more rows
ReDim outputArr(1 To 2 * (UBound(arr, 1) - 1), 1 To UBound(arr, 2) / 2)
For i = 2 To UBound(arr, 1)
For j = LBound(arr, 2) To UBound(arr, 2) Step 4
r = r + 1
outputArr(r, 1) = arr(i, j + 3)
outputArr(r, 2) = arr(i, j)
outputArr(r, 3) = arr(i, j + 1)
outputArr(r, 4) = arr(i, j + 2)
Next
Next
ws.Cells(5, 1).Resize(UBound(outputArr, 1), UBound(outputArr, 2)) = outputArr
End Sub
If students can have different numbers of semesters set your table up to the max possible number of semesters and leave blank those semesters no quizz for a given student then use code:
Option Explicit
Public Sub test()
Dim arr(), ws As Worksheet, i As Long, j As Long, r As Long, c As Long, outputArr(), numberOfColumns As Long
Set ws = ThisWorkbook.Worksheets("Sheet5"): arr = ws.[B1:M3].Value
numberOfColumns = UBound(arr, 2) / 4
ReDim outputArr(1 To numberOfColumns * (UBound(arr, 1) - 1), 1 To UBound(arr, 2) / numberOfColumns)
For i = 2 To UBound(arr, 1)
For j = LBound(arr, 2) To UBound(arr, 2) Step 4
r = r + 1
outputArr(r, 1) = arr(i, j + 3)
outputArr(r, 2) = arr(i, j)
outputArr(r, 3) = arr(i, j + 1)
outputArr(r, 4) = arr(i, j + 2)
Next
Next
ws.Cells(Ubound(arr,1) + 5 , 1).Resize(UBound(outputArr, 1), UBound(outputArr, 2)) = outputArr
End Sub
Example layout where maximum semesters is 3 and 1 student only completed 2 semesters:
