把它翻译一下就行了。
Private Function cacl(num As Long) As String
Dim numlen As Long, last As Long, x As Long
Dim i As Long, m As Long, n As Long
Dim result() As Long, starttime As Single
numlen = 1
starttime = Timer
ReDim result(1 To numlen)
result(1) = 1
x = 1
Do While x <= num
last = 0
For i = 1 To numlen
m = result(i) * x + last
result(i) = m Mod 10
last = m / 10
Next
If last > 0 Then
n = Len(CStr(last))
ReDim Preserve result(1 To numlen + n)
For i = 1 To n
result(numlen + i) = last Mod 10
last = last / 10
Next
numlen = UBound(result)
End If
x = x + 1
Loop
ReDim s(1 To numlen)
For i = 1 To numlen
s(i) = result(numlen + 1 - i)
Next
cacl = Join(s, "")
Debug.Print num &
"! : 用时 "
Timer - starttime &
" 秒, 结果 " &
numlen &
" 位"
End Function
Private Sub Command1_Click()
Dim i As Long
For i = 1 To 10
cacl i * 100
Next
'For i = 1 To 10
'cacl i * 1000
'Next
End Sub
赶紧结贴吧。