Sub 成績檢查()
Dim rowpos As Integer
Dim colpos As Integer
Dim num As Integer
Set ws = Worksheets("sheet1")
'國語
rowpos = 2
colpos = 2
Do
If ws.Cells(rowpos, colpos) = " " Then
Exit Do
End If
num = ws.Cells(rowpos, colpos)
If num >= 85 Then
ws.cells(rowpos, colpos).Interior.ColorIndex = 8
End If
rowpos = rowpos + 1
Loop While num >= 1
'數學
rowpos = 2
colpos = 3
Do
If ws.Cells(rowpos, colpos) = " " Then
Exit Do
End If
num = ws.Cells(rowpos, colpos)
If num >= 85 Then
ws.cells(rowpos, colpos).Interior.ColorIndex = 8
End If
rowpos = rowpos + 1
Loop While num >= 1
End Sub
               (
geocities.com/hk)