- Sub t()
- Dim tim1 As Date, tim2 As Date: tim1 = Timer
- Dim i&, arr%(), x&
- Application.ScreenUpdating = False
- x = [A2]
- ReDim arr%(1 To x, 1 To 1)
- For i = 1 To x
- arr(i, 1) = Rnd() \ 1
- Next
- [B:B].ClearContents
- [B1].Resize(x) = arr
- tim2 = Timer
- MsgBox Format(tim2 - tim1, "程序执行时间为:0.00秒"), 64, "时间统计"
- Application.ScreenUpdating = True
- End Sub
复制代码 |