需要一個常駐記憶體的程序來監控函式的莫個變數去觸發輸出陣列。網上找的的程式碼
執行auto_open, 然後任意單元格輸入 =X(10)
Dim R As Range
Dim dtNext As Date
Sub Auto_Open()
StartProcess
End Sub
Sub Auto_Close()
StopProcess
Function X(Size As Integer)
Set R = Application.Caller.Offset(1, 1).Resize(Size, Size)
X = 1
End Function
Sub FillRange()
If Not R Is Nothing Then
R.Value = R.Rows.Count
Set R = Nothing
End If
"StartProcess
Sub StartProcess()
dtNext = Now + TimeValue("0:0:2")
Application.OnTime dtNext, "FillRange"
Sub StopProcess()
Application.OnTime dtNext, "FillRange", schedule:=False
需要一個常駐記憶體的程序來監控函式的莫個變數去觸發輸出陣列。網上找的的程式碼
執行auto_open, 然後任意單元格輸入 =X(10)
Dim R As Range
Dim dtNext As Date
Sub Auto_Open()
StartProcess
End Sub
Sub Auto_Close()
StopProcess
End Sub
Function X(Size As Integer)
Set R = Application.Caller.Offset(1, 1).Resize(Size, Size)
X = 1
End Function
Sub FillRange()
If Not R Is Nothing Then
R.Value = R.Rows.Count
Set R = Nothing
End If
"StartProcess
End Sub
Sub StartProcess()
dtNext = Now + TimeValue("0:0:2")
Application.OnTime dtNext, "FillRange"
End Sub
Sub StopProcess()
Application.OnTime dtNext, "FillRange", schedule:=False
End Sub