View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default OldValue property

There is no OldValue property

In the change event you would use some code similar to this pseudocode.

Dim OldValue as Variant
Dim NewValue as Variant
Applicaton.EnableEvents = False
NewValue = Target.Value
Application.Undo
OldValue = Target.Value
Target.value = NewValue
Application.EnableEvents = True

--
Regards,
Tom Ogilvy


"Lulu" wrote in message
...
In Access there is a property called OldValue. It holds onto the value

when
a field is changed. What I am looking for is something similar in Excel.

I've written a Worksheet_Change event which will look for a value entered
into a cell within a certain specified range to make sure the value hasn't
already been entered elsewhere in the range. The only thing I need is a

way
to retain the OldValue in case I need to recall the value and nullify the
change.

Ideas?

Thanks