不清楚你的逻辑,不好改,对vba也不太熟悉
Line2:
Dim a2, b2, c2, b3, c3, n, h As Integer
a2 = TextBox4.Text
If TextBox5.Text > "" Then b2 = TextBox5.Text Else b2 = 0
If TextBox6.Text > "" Then c2 = TextBox6.Text Else c2 = 0
If TextBox7.Text = "" Or TextBox8.Text = "" Then GoTo Line4
n = TextBox7.Value
h = TextBox8.Value
For i = h To h + a2 - 1
Cells(i, n).Value = "一等奖"
Next
b3 = h + a2
For i2 = b3 To h + a2 + b2 - 1
Cells(i2, n).Value = "二等奖"
Next
c3 = h + a2 + b2
For i3 = c3 To h + a2 + b2 + c2 - 1
Cells(i3, n).Value = "三等奖"
Next
GoTo LastLine