I have a cell (lets call it A1) which is populated from an external application (DDE).
The value in the cell will be a 32 Bit Long (Double Word)
I want to check this cell every second and see if it has changed its value from 1 (one) second before. If it has changed I then want to check every BIT in the word to find any bit that has changed and whether it changed from 0 to 1 or 1 to 0
(I am making an assumption here that VBA can address individual bits using the notation 'variable.nn' )
If the value has changed I want to check each BIT (00 to 31) of the value to see if that BIT is TRUE or FALSE (1 or 0) Every time I find a BIT that has changed I will then run another sub routine based on the condition change ( Change to 1 or Changed to 0)
Once I have finished checking all 32 BITs I will then EXIT and wait for 1 second before i check again.
I am obviously no VBA expert so the best way I can describe what I want to do is along the lines ...... (I am using a variable called CellPrev to remember what the value if the cell was last time I checked it and on that basis I am guessing the my variable CellPrev will have to be a 'Global' ?)
EVERY SECOND call routine .....
Dim Cell as Long
Cell = A1
IF Cell == CellPrev then EXIT
If Cell.00 <> CellPrev.00 then
IF Cell.00 = TRUE call routine Cell00_True
call routine Cell00_False
If Cell.01 <> CellPrev.01 then
IF Cell.01 = TRUE call routine Cell01_True
call routine Cell01_False
If Cell.02 <> CellPrev.02 then
IF etc etc
CellPrev = Cell