Sub mymacro()
Dim i As Integer
Dim score As Integer
Dim maxscore As Integer
Dim k As Integer
maxscore = Cells(1, 1).Value
k = 1
For i = 2 To 20 score = Cells(i, 1).Value
If score > maxscore Then
maxscore = score
k = i
End If
Next i
Range(“B22”).Value = maxscore
Range(“B23”).Value = k
End Sub
Excel VBA おさらい問題の解答2026/7/12
Ecel VBA学習記録

コメント