RTD 幾個問題想請教 - 財經

By Elma
at 2017-11-20T19:16
at 2017-11-20T19:16
Table of Contents
最簡單是用Worksheet_Calculate
但這個方法無法區分是哪個儲存格的資料被更新
可以用UDF(user defined function)的方式就能知道是哪個儲存格資料被更新
假設儲存格資料如下
A1 = RTD("money.excel", , "GC1712.CME", "Volume")
B1 = test_udf1(A1)
開啟VBA編輯器
插入模組並輸入下面function
Function test_udf1(rng As Range)
test_udf1 = rng.Value2
' 在這裡就可以使用rng參數自行儲存所需的tick資料
End Function
這樣每當A1儲存格資料被更新就會觸發B1儲存格
也就是會呼叫一次test_udf1(A1) function
--
但這個方法無法區分是哪個儲存格的資料被更新
可以用UDF(user defined function)的方式就能知道是哪個儲存格資料被更新
假設儲存格資料如下
A1 = RTD("money.excel", , "GC1712.CME", "Volume")
B1 = test_udf1(A1)
開啟VBA編輯器
插入模組並輸入下面function
Function test_udf1(rng As Range)
test_udf1 = rng.Value2
' 在這裡就可以使用rng參數自行儲存所需的tick資料
End Function
這樣每當A1儲存格資料被更新就會觸發B1儲存格
也就是會呼叫一次test_udf1(A1) function
--
Tags:
財經
All Comments

By Damian
at 2017-11-24T21:51
at 2017-11-24T21:51
Related Posts
RTD 幾個問題想請教

By Kristin
at 2017-11-18T19:43
at 2017-11-18T19:43
感恩節MC代買

By Joe
at 2017-11-10T23:33
at 2017-11-10T23:33
出場策略的回測,是不是一定要用迴圈?

By Hardy
at 2017-11-10T03:05
at 2017-11-10T03:05
運用財訊股市總覽理財

By Todd Johnson
at 2017-11-08T00:25
at 2017-11-08T00:25
2017/11/07 唷齁齁節前夕閒聊

By Rosalind
at 2017-11-07T10:20
at 2017-11-07T10:20