Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does someone knows if exist any way of getting the old value in this:
Private Sub Worksheet_Change(ByVal Target As Range) €˜ for the new data coming is easy: New_data = Target.Value €˜And about the old data into the cell€¦. Is there something like: Old_data = Target.Old_data End Sub Thanks a lot Peres |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You will need to "remember" the old value by storing it in a static variable.
-- Gary''s Student - gsnu200737 "Peres from Brasil" wrote: Does someone knows if exist any way of getting the old value in this: Private Sub Worksheet_Change(ByVal Target As Range) €˜ for the new data coming is easy: New_data = Target.Value €˜And about the old data into the cell€¦. Is there something like: Old_data = Target.Old_data End Sub Thanks a lot Peres |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tanks very, very much, you help me in 2 ways because I didnt know how to
create a variable that could be seen inside the subs... Tanks again! "Halim" wrote: Peres, This will help you: Option Explicit Private Old_data Private New_data ' Private Sub Worksheet_Change(ByVal Target As Range) New_data = Target.Value MsgBox "Change from '" & Old_data & "' to '" & New_data & "'" End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) Old_data = Target.Value End Sub -- Regards, Halim "Gary''s Student" wrote: You will need to "remember" the old value by storing it in a static variable. -- Gary''s Student - gsnu200737 "Peres from Brasil" wrote: Does someone knows if exist any way of getting the old value in this: Private Sub Worksheet_Change(ByVal Target As Range) €˜ for the new data coming is easy: New_data = Target.Value €˜And about the old data into the cell€¦. Is there something like: Old_data = Target.Old_data End Sub Thanks a lot Peres |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problems using Worksheet_Change | Excel Programming | |||
problems with Worksheet_Change function when drop-down lists | Excel Programming | |||
Problems with "Worksheet_Change" | Excel Discussion (Misc queries) | |||
worksheet_change problems | Excel Programming |