Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
View previous cell value programmically
I have a vba macro that is kicked off from ThisWorkbook whe Workbook_SheetChange event occurs. When the user inputs or updates a value in a cell - I'd like to kno the previous value. What object will provide me with tha information? Thanks! -Robi -- stratagur ----------------------------------------------------------------------- strataguru's Profile: http://www.excelforum.com/member.php...nfo&userid=131 View this thread: http://www.excelforum.com/showthread.php?threadid=26291 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
View previous cell value programmically
hi,
i dont' think you can. once changed and you aint' there to see it...it's gone. you could write code that copies all NEW entries to a history sheet/file with control name, new value, date, time, ect. you could then search past data to find it. -----Original Message----- I have a vba macro that is kicked off from ThisWorkbook when Workbook_SheetChange event occurs. When the user inputs or updates a value in a cell - I'd like to know the previous value. What object will provide me with that information? Thanks! -Robin -- strataguru ---------------------------------------------------------- -------------- strataguru's Profile: http://www.excelforum.com/member.php? action=getinfo&userid=1313 View this thread: http://www.excelforum.com/showthread...hreadid=262910 . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
View previous cell value programmically
Robin,
Use this in the change event: Dim NewVal As Variant Dim OldVal As Variant If Target.Cells.Count < 1 Then Exit Sub NewVal = Target.Value With Application .EnableEvents = False .Undo OldVal = Target.Value .Undo .EnableEvents = True End With MsgBox "The old value was " & OldVal & Chr(10) & _ "The new value is " & NewVal HTH, Bernie MS Excel MVP "strataguru" wrote in message ... I have a vba macro that is kicked off from ThisWorkbook when Workbook_SheetChange event occurs. When the user inputs or updates a value in a cell - I'd like to know the previous value. What object will provide me with that information? Thanks! -Robin -- strataguru ------------------------------------------------------------------------ strataguru's Profile: http://www.excelforum.com/member.php...fo&userid=1313 View this thread: http://www.excelforum.com/showthread...hreadid=262910 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
3-Color Scale Vlookup for Current Month/Previous/Pre-Previous | Excel Discussion (Misc queries) | |||
How can I copy a value from a cell and paste it into another cell while adding it to the previous value in that cell | Excel Worksheet Functions | |||
Creating Variables Programmically | Excel Discussion (Misc queries) | |||
Edit Data Query Programmically? | Excel Programming | |||
How do I change a function's otional parameter default values programmically | Excel Programming |