如何每10分钟发送一次数据到Excel中的单独工作表?

时间:2022-12-17 01:08:17

I have a worksheet with live data of a currency value relative to a USD that updates every 10 minutes in cell e2, and a live clock in cell d2. I would like to record both of these values every 10 minutes in another worksheet, so I have an account of the daily volatility of the value. What is the best way to do this?

我有一个工作表,其中包含相对于美元的货币值的实时数据,该数据在单元格e2中每10分钟更新一次,在单元格d2中更新实时时钟。我想在另一个工作表中每10分钟记录这两个值,因此我记录了该值的每日波动率。做这个的最好方式是什么?

Thank you for the help.

感谢您的帮助。

1 个解决方案

#1


5  

This will copy the values from D2 and E2 on Sheet1, to D2 and E2 on Sheet2, adding a new row on Sheet2 every time a row is copied.

这会将Sheet1上D2和E2的值复制到Sheet2上的D2和E2,每次复制行时在Sheet2上添加一个新行。

It will run automatically every 10 minutes.

它将每10分钟自动运行一次。

Sub CopyValues()
Dim RowNo As Long
RowNo = Sheets(2).Cells(Rows.Count, 4).End(xlUp).Row + 1

    Sheets(2).Cells(RowNo, 4) = Sheets(1).Cells(2, 4)
    Sheets(2).Cells(RowNo, 5) = Sheets(1).Cells(2, 5)

Application.OnTime Now + TimeValue("00:10:00"), "CopyValues"

End Sub

#1


5  

This will copy the values from D2 and E2 on Sheet1, to D2 and E2 on Sheet2, adding a new row on Sheet2 every time a row is copied.

这会将Sheet1上D2和E2的值复制到Sheet2上的D2和E2,每次复制行时在Sheet2上添加一个新行。

It will run automatically every 10 minutes.

它将每10分钟自动运行一次。

Sub CopyValues()
Dim RowNo As Long
RowNo = Sheets(2).Cells(Rows.Count, 4).End(xlUp).Row + 1

    Sheets(2).Cells(RowNo, 4) = Sheets(1).Cells(2, 4)
    Sheets(2).Cells(RowNo, 5) = Sheets(1).Cells(2, 5)

Application.OnTime Now + TimeValue("00:10:00"), "CopyValues"

End Sub