I have a formula in cell "D1" for receiving RTD, which works and get continuously updated data. Now, I need a copy of this cell (only VALUE) in another cell "B2", same worksheet. When i try the code I have found so far, the "B2" cell stays empty. For test reasons I have copied another cell value (constant value) to "B2" and this worked. Therefore, I believe there is a problem with copying RTD values.
I have started in the beginning with simply copying the values:
Sheets("New sheet").Range("B2") = Sheets("New sheet").Range("D1").value
or:
Sheets("New sheet").Range("B2").value = Sheets("New sheet").Range("D1").value
Then I have started to look for other solutions, like:
Sheets("New sheet").Range("D1").Select
enter code here`Selection.Copy
Sheets("New sheet").Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
or:
Sheets("New sheet").Range("B2").Copy Sheets("New sheet").Range("D1").value
Did not have success with this.
Then I played around with the interval the data in "D1" is received. Perhaps the copy code struggles with too frequent data. So i changed the Trottle Interval to several numbers up to 10.000, but this didn't change the result.
Application.RTD.ThrottleInterval=0
Additional information:
I enter the formula for receiving RTD data in "D1" directly before I copy the value to "B2".
Also tried the application.Wait
function to give the data time to update, but since the macro freezes in this time, it made no change.
Moreover, have simulated a time delay with a while loop between entering RTD-formula and copy the values to the other cell.
Macro security settings: Enabled trusting VBA-projectObjectModul and all macros are active.
Do you have any ideas how to solve this? Thanks in advance!
UPDATE: I solved it by only placing the RTD formula in "D1" in the current sub and when this sub is finished, I call another sub that copies the value from "D1" to "B2" > This works. It did not work by calling another sub in the current sub, it has to be finished first.
Thank you all for the input, appreciate! :)