ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to save a snapshot of data? (https://www.excelbanter.com/excel-programming/339069-macro-save-snapshot-data.html)

DustinS

Macro to save a snapshot of data?
 
I have a range of 30 cells that are linked to an outside source that is
updating them in 10 second cycles. I also have a cell that counts the
accumulating cycles.

I have a line chart that shows me the cell variation in real time.

I would like to take a sample of the values in those 30 cells once every 10
thousand cycles and save them to another sheet so that I can chart change
trends over the long term.

Doe anyone have an example of how I could do this?

Regards, Dustin




Gary's Student

Macro to save a snapshot of data?
 
Assuming that you have code that runs at every update, include a call to:

CycleCheck()

then enter

Sub CycleChecker()
cyclecounter=cyclecounter + 1
if cyclecounter=10000 then
cyclecounter=0
' insert logic to do transfer
end if
end sub

You will need to Dim cyclecounter as long outside the sub to make it static.

This is un-checked code
--
Gary's Student


"DustinS" wrote:

I have a range of 30 cells that are linked to an outside source that is
updating them in 10 second cycles. I also have a cell that counts the
accumulating cycles.

I have a line chart that shows me the cell variation in real time.

I would like to take a sample of the values in those 30 cells once every 10
thousand cycles and save them to another sheet so that I can chart change
trends over the long term.

Doe anyone have an example of how I could do this?

Regards, Dustin






All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com