2017-06-14 10 views
0

私はプログラマーではありません。私は助けが必要です。私はWebサイトにリンクし、リアルタイムでセルの値を表示するExcelのテーブルを持っています。私は2分後に毎回変化する細胞の価値を保存しようとしています。セルの値を別のセルに自動的に保存してから、次の分の値に変更します(自動リフレッシュをExcelで実行する前に)。セルがリアルタイムデータを受信して​​いるためです。私は古いデータを保存し、計算に使用したいと思います。私は自動的にそれをしたい。どのように私はそれをExcelを使用して行うのですか?あなたの助けに感謝します。スタック内のリアルタイムデータを自動的に保存する

答えて

0

私は一日中テキストファイルにデータを追加してから、いつ、どこかで、あるいは終わりに、あるいは必要に応じて、いくつかの分析を行います。

'Starting the program and sub procedure to write VBA code to write the data to a text file Append. 
Sub VBA_to_append_existing_text_file() 

'Declaring the strFile_Path variable as String Data Type to store the text file path. 
Dim strFile_Path As String 

'Assigning the Existing File path to the variable strFile_Path. 
strFile_Path = "C:\your_path_here\test.txt" 

'Opening the text file for Append with FileNumber as 1. 
Open strFile_Path For Append As #1 

'Writing to the sample text to the File using FileNumber and Write Command. 
YourValue = Worksheets("Sheet1").Range("A1").Value 
Write #1, YourValue 

'Closing the File using FileNumber. 
Close #1 

End Sub 

2分ごとにマクロを実行します。

Sub my_Procedure() 
    MsgBox "hello world"   
    Call test ' for starting timer again 
End Sub 

Sub test() 
    Application.OnTime Now + TimeValue("00:02:00"), "my_Procedure" 
End Sub 

アナリティクスにはExcelまたはRを使用できます。

関連する問題