|
figfig老师,下面的这个贴子http://club.excelhome.net/thread-274302-1-1.html
我用ruby做了一下,用时0.48s没有狼版的运行速度快(0.18s),不过算法简洁容易理解,我想问一下大师,这段代码用ruby还可以优化提速吗?
Sub RUBY()
t = Timer
Application.ScreenUpdating = False
a = Application.Transpose([a1:a60000])
b = Application.Transpose([b1:b60000])
c = Application.Transpose([c1:c60000])
Set x = CreateObject("scriptcontrol")
x.Language = "rubyscript"
x.eval ("def test(aa,bb,cc) a & b & c end;")
y = x.Run("test", a, b, c)
[d1].Resize(UBound(y) + 1) = Application.Transpose(y)
Application.ScreenUpdating = ture
t = Timer - t
MsgBox t
End Sub
[ 本帖最后由 aidixiao 于 2010-5-21 08:50 编辑 ] |
|