Dim tb As Table = Tables("投标测算_Table2") Dim val1 As Double = CDbl(e.Form.Controls("TextBox2").Value) Dim val2 As Double = CDbl(e.Form.Controls("TextBox3").Value) Static i As Integer = 1 For Each rw As Row In tb.Rows Dim n = Rand.Next(val1,val2) If rw("随机测算_" & i) = Nothing Then rw("随机测算_" & i) = n End If If i < 7 i += 1 Else i = 1 End If Next