sheet1,第一行第一格开始连写40个
Sub r40()
While i <= 40
i = i + 1
Randomize
Sheet1.Cells(1, i).Value = 2.37 + Round(Rnd() * 0.09, 2)
If i <> 1 Then
If Abs(Sheet1.Cells(1, i).Value - Sheet1.Cells(1, i).Value) > 0.02 Then
i = i - 1
End If
End If
Wend
End Sub