或者调用JAVASCRIPT:
程序代码:
Sub test() Dim s1, s2, dic As Object, js As Object, i&, j& s10 = "/1/4/9/16/25/1/8/27/64/125/1/32/243/1024/3125/1/128/2187/16384/78125" s11 = "/2/5/8/9/10/12/13/16/17/18/20/24/25/26/28/29/31/32/33/34/35/36/40/41/43/48/50/52/54/57/59/64/65/68/72/73/80/89/91/96/126/128/129/132/133/134/136/137/141/144/150/152/153/155/157/160/189/192/244/247/250/251/252/253/256/259/268/270/275/307/368/371/486/1025/1028/1032/1033/1040/1049/1051/1056/1088/1149/1152/1267/2048/2188/2191/2195/2196/2203/2212/2214/2219/2251/2312/2315/2430/3126/3129/3133/3134/3141/3150/3152/3157/3189/3211/3250/3253/3368/4149/4374/5312/6250/16385/16388/16392/16393/16400/16409/16411/16416/16448/16509/16512/16627/17408/18571/19509/32768/78126/78129/78133/78134/78141/78150/78152/78157/78189/78250/78253/78368/79149/80312/81250/94509/156250" s1 = Split(s10, "/") s2 = Split(s11, "/") Set dic = CreateObject("scripting.dictionary") For i = 1 To UBound(s1) For j = 1 To UBound(s2) dic(Val(s1(i)) + Val(s2(j)) & "") = Val(s1(i)) + Val(s2(j)) Next j, i Set js = CreateObject("msscriptcontrol.scriptcontrol") js.Language = "javascript" js.AddCode "function sorts(arr){return arr.toArray();}" Debug.Print js.codeobject.sorts(dic.items) End Sub