If 新しい値 > 現在の最大値 Then
現在の最大値 = 新しい値
End If
Sub MyMacro()
Dim i As Integer
Dim score As Integer
Dim scoremax As Integer
scoremax = Cells(1,1).Value
For i = 1 To 20
score = Cells(i,1).Value
If score > scoremax Then
scoremax = score
End If
Next i
Cells(22,2).Value = scoremax
End Sub
Excel VBA解答 2026/7/11
Ecel VBA学習記録

コメント