|
首先。佩服你能写这么多代码。
俺是看不懂
Option Explicit
Sub Main(Args)
On Error Resume Next
Dim t: t = Timer
If Not 设置.Pre Then
MsgBox "请核对历史查询表,使相关参数能一一对应"
Exit Sub
End If
Dim i, j, n As Integer, Ele
Dim Rtn, DataList(), Result, Model As Boolean
For i = Args(0) To Args(UBound(Args))
Model = False
Set Rtn = ReFreshData(Args(0) + n)
ReDim DataList(Rtn.Count - 1)
If Not Model Then
If Sheets(设置.ShName(i)).Cells(设置.GetLstRow(i), 设置.GetDataStartColumn) = "" Then
Model = True
Else
ReDim Preserve DataList(Rtn.Count - 2)
End If
For j = IIf(Model, 0, 1) To Rtn.Count - 1
DataList(j - IIf(Model, 0, 1)) = Split(Rtn(j), " ")
Next
Result = Application.Transpose(Application.Transpose(DataList))
If UBound(DataList, 1) > 0 Then
Sheets(设置.ShName(i)).Cells(设置.GetLstRow(i) + 1, 设置.GetDataStartColumn).Resize(UBound(Result, 1), UBound(Result, 2)) = Result
Else
Sheets(设置.ShName(i)).Cells(设置.GetLstRow(i) + 1, 设置.GetDataStartColumn).Resize(1, UBound(Result, 1)) = Result
End If
End If
n = n + 1
Next
MsgBox "本次耗费" & Format(Timer - t, "0.00") & "秒"
End Sub
另外。弱弱问下。你中奖后。会告诉我们吗>?. |
|