0

I want to store the value from a RTD function which is continuously changing. Suppose I set cell A1 = SomeRTDFunction(). How should I approach this?

One possibility I have in mind is maybe to create a Sub that runs continuously on some timer than copy the value from that cell and put it into another cell continuously.

Is there a better way to do this?

Community
  • 1
  • 1
harinsa
  • 3,176
  • 5
  • 33
  • 53
  • I think this thread answers your question: [http://stackoverflow.com/questions/28397363/pause-rtd-server-in-excel-and-save-worksheet][1] [1]: http://stackoverflow.com/questions/28397363/pause-rtd-server-in-excel-and-save-worksheet – Pavel Mar 08 '15 at 16:20

1 Answers1

0

This would update the Range("A1").Value with Your_RTD_Function every second.

Sub RunRTDFunctionContinuously()

    Dim nextSecond As Date

    nextSecond = DateAdd("s", 1, Now())

   'Your instruction below  

   Range("A1").Value = Your_RTD_Function

    Application.OnTime _
        Procedure:="RunRTDFunctionContinuously", _
        EarliestTime:=nextSecond

End Sub
Amen Jlili
  • 1,884
  • 4
  • 28
  • 51
  • My function is already outputting its value in A1. What I want is to create a log/chart of its value over time. – harinsa Jan 29 '15 at 16:27
  • You can start an instruction that adds a `seriescollection` to a `chartobject` that you create and over every second the chart will update. – Amen Jlili Jan 29 '15 at 16:34