Sub ct()
Randomize
For i = 1 To 25
a = Int(Rnd() * 100 + 1)
b = Int(Rnd() * (100 - 1) - a)
c = Int(Rnd() * (100 - a - b) - a - b)
Cells(i, 1) = a & IIf(b >= 0, "+" & b, b) & IIf(c >= 0, "+" & c, c)
Cells(i, 3) = a & IIf(b >= 0, "+" & b, b) & IIf(c >= 0, "+" & c, c)
Cells(i, 5) = a & IIf(b >= 0, "+" & b, b) & IIf(c >= 0, "+" & c, c)
Cells(i, 7) = a & IIf(b >= 0, "+" & b, b) & IIf(c >= 0, "+" & c, c)
Next i
End Sub
插入模块,你懂得