apologies as I'm quite new with this. I have this VBA macro:
Sub ScoreTest()
Dim score As Integer, result As String
score = Range("D2").Value
If score >= Range("E2").Value Then
result = "pass"
Else
result = "fail"
End If
Range("F2").Value = result
End Sub
Of course, this only works for Row 2. I edited the macro to apply to rows 2 til 16, but that was just me copy pasting so it looked like so:
Sub ScoreTest()
Dim score As Integer, result As String
score = Range("D2").Value
If score >= Range("E2").Value Then
result = "achieved"
Else
result = "failed"
End If
Range("F2").Value = result
score = Range("D3").Value
If score >= Range("E3").Value Then
result = "achieved"
Else
result = "failed"
End If
Range("F3").Value = result
score = Range("D4").Value
If score >= Range("E4").Value Then
result = "achieved"
Else
result = "failed"
End If
Range("F4").Value = result
...
End Sub
Which loop function would I use in this scenario instead of copy+pasting the macro for each row?