edthehorse
08-29-2012, 06:10 AM
Hey
i'm very much a noobie with VBA, i've managed to play around with different macros and functions but i've been banging my head against a wall trying to figure out this one :banghead:
I've tried some simple functions and found one or two that worked but nothing did exactly what i wanted, the latest one worked fine until the cell that triggered the boolean that started the timestamp updated and the timestamp would also update.
i was trying to maybe use a Static variable but then i'm not sure how to Reset the value.
Function Timestamper (Cell, Condition)
If Evaluate(Cell.Value & Condition) Then
Timestamper = Now
Else
Timestamper = TimeValue("00:00:00")
End If
Exit Function
End Function
the cell referenced is a bool that flips from 0 to 1 based on a formula. A cell in the formula also references a cell that records the max of another cell, even though the max doesnt change when the cell its recording the max does the timestamp reprints now.
Ideally i could make the initial 'NOW' stamp a static variable that would only change when something resets it..
I tried playing with some code for recording and resetting a running max function that i found on the forum but i cant get it to do what i want!
Any help would be appreciated
Thanks in Advance
i'm very much a noobie with VBA, i've managed to play around with different macros and functions but i've been banging my head against a wall trying to figure out this one :banghead:
I've tried some simple functions and found one or two that worked but nothing did exactly what i wanted, the latest one worked fine until the cell that triggered the boolean that started the timestamp updated and the timestamp would also update.
i was trying to maybe use a Static variable but then i'm not sure how to Reset the value.
Function Timestamper (Cell, Condition)
If Evaluate(Cell.Value & Condition) Then
Timestamper = Now
Else
Timestamper = TimeValue("00:00:00")
End If
Exit Function
End Function
the cell referenced is a bool that flips from 0 to 1 based on a formula. A cell in the formula also references a cell that records the max of another cell, even though the max doesnt change when the cell its recording the max does the timestamp reprints now.
Ideally i could make the initial 'NOW' stamp a static variable that would only change when something resets it..
I tried playing with some code for recording and resetting a running max function that i found on the forum but i cant get it to do what i want!
Any help would be appreciated
Thanks in Advance