Compare Current Value with Old Value for data collected in Real Time

FermentationGuy

New Member
Joined
Jan 7, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am running a fermentation software that uses VBA. I am looking for the script to trigger a response to occur as soon as one of the values drops below it's previously logged value (Example: 1, 2, 3, 4, 2 > Trigger response) (aka the beginning of a negative slope on a curve). This is all real-time values and needs to be triggered as soon as this drop happens.
1641571683084.png

(Example of the point on the curve I want the response triggered at)

Is there a way to have a script log and save a value, wait a couple minutes, log the same variable again, and compare the current and old values? And do this continuously until the value drops?

Any help would be much appreciated!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Should be doable, but not enough info - at least for me. What application is the vba in? Log where, sheet? Doc? Text file? Database table?
Simplest answer might be a module level variable that holds the last value and each time the event fires, the comparison is made.
Or global variable (less attractive option IMO) or TempVars. The value cannot be stored in timer event procedure.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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