所有代码加在一起只有五十行,看看效果,这个老外真牛.
Sub spin()
Dim out As Variant
Dim j As Integer, k As Integer
Dim s(3) As Integer
On Error Resume Next
Application.Calculation = xlCalculationManual
Application.StatusBar = ""
out = Array("L2", "L6", "L10")
s(0) = Worksheets("hidden").Range(out(0))
s(1) = Worksheets("hidden").Range(out(1))
s(2) = Worksheets("hidden").Range(out(2))
For j = 0 To 2
For k = 0 To 360
Worksheets("hidden").Range(out(j)) = (s(j) + k) Mod 360
Calculate
Next k
Next j
For k = 1 To 360
Worksheets("hidden").Range(out(0)) = (s(0) + k) Mod 360
Worksheets("hidden").Range(out(1)) = (s(1) + k) Mod 360
Worksheets("hidden").Range(out(2)) = (s(2) + k) Mod 360
Calculate
Next k
Application.DisplayStatusBar = oldStatusBar
Application.Calculation = xlCalculationAutomatic
End Sub
Sub spin()
Dim inp As Range, out As Variant
Dim j As Integer, k As Integer
Dim s(3) As Integer
Application.Calculation = xlCalculationManual
out = Array("AF1", "AF7", "AF13")
Set inp = ActiveSheet.Range("F26")
s(0) = Range(out(0))
s(1) = Range(out(1))
s(2) = Range(out(2))
For j = 0 To 2
For k = 1 To 360
Range(out(j)) = (s(j) + k) Mod 360
Calculate
Next k
Next j
For k = 1 To 360
Range(out(0)) = (s(0) + k) Mod 360
Range(out(1)) = (s(1) + k) Mod 360
Range(out(2)) = (s(2) + k) Mod 360
Calculate
Next k
Application.Calculation = xlCalculationAutomatic
End Sub
阅读(2136) | 评论(2) | 转发(0) |