Taking a data from a cell & keep displaying in subsequent rows in a column?

ansEEE

New Member
Joined
Jan 10, 2019
Messages
1
I want to sample a variable data in a cell say C3 & to display that data after every 1 second (Means sampling rate is 1 Hz) into the rows (one after one) in a column say D. To explain, after starting up the Macro, value of C3 should display in D1 and after 1 second updated value of C3 should display in D2 and so on for 900 times because I want this sampling for 15 minutes (15*60=900 seconds) and want to know average (of course variable) of those 900 cells (filled as well as empty) from D1 to D900.to achieve this I have used following code " Option ExplicitPublic dTime As DateSub ValueStore()Dim dTime As Date Range("D" & Cells(Rows.Count).Row).End().Offset(1, 0).Value = Range("C3").Value Call StartTimerEnd SubSub StartTimer() dTime = Now + TimeValue("00:00:01") Application.OnTime dTime, "ValueStore", Schedule:=TrueEnd SubSub StopTimer() On Error Resume Next Application.OnTime dTime, "ValueStore", Schedule:=FalseEnd Sub "Two separate Command Buttons are created for StartTimer() & StopTimer(). Now 1st problem is Value starts displaying from Cell D2 but that is not an issue for me. The main issue is above code gives only 63 sampled values means from D2 to D64 & after that no data displays in D65 and subsequent cells but Value of D3 keeps updating. I could not understand why D65 & subsequent cells are not displaying updated C3 value. There seems nothing that put limit at 63 values & why value of D3 keeps updating? Please help me out.Additional Functionality Required:Now, I want to display only 900 values after that (15 minutes) all cells from D2 to D64 should be blank and whole process of sampling should start from D2 to D901 so that I can watch variable Average of next one by one 900 values also. Can somebody provide me additional code for this?I use MS Office 2013.Sincere thanks in advance.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,215,374
Messages
6,124,569
Members
449,173
Latest member
Kon123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top