Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I want to write a handler which will be called when the user changes the contents of a cell and I need to get the value in this cell before modification.Is there any way to do this? Thanks in advance Regards Raghu |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Raghu
The following sub (insert in the relevant worksheet module) will record any changes made to cell A1 and place the value prior to changing in column F and the time it was changed in column G. Private Sub Worksheet_Change(ByVal Target As Range) Static vLast As Variant If Target.Address = "$A$1" Then If vLast < Target.Value Then Range("F65000").End(xlUp).Offset(1, 1) = Now Range("F65000").End(xlUp).Offset(1, 0) = vLast vLast = Target.Value End If End If End Sub -- XL2002 Regards William "Raghunandan" wrote in message ... | Hi All, | I want to write a handler which will be called when the user changes the | contents of a cell and I need to get the value in this cell before | modification.Is there any way to do this? | | Thanks in advance | | Regards | Raghu | |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I think I was not clear enough.My requirement is like this.I have a worksheet in which i need to implement 1 to many relationship between data.So I maintain 2 sheets.The data relationship is somewhat like this 1st sheet: name description unique_id index qwert qwerty 1 200 2nd sheet: index data 200 asdf 200 zxc if the user changes the index in 1st sheet,I need to go and change the indexes in 2nd sheet I don't know how to do this Regards Raghu "William" wrote: Hi Raghu The following sub (insert in the relevant worksheet module) will record any changes made to cell A1 and place the value prior to changing in column F and the time it was changed in column G. Private Sub Worksheet_Change(ByVal Target As Range) Static vLast As Variant If Target.Address = "$A$1" Then If vLast < Target.Value Then Range("F65000").End(xlUp).Offset(1, 1) = Now Range("F65000").End(xlUp).Offset(1, 0) = vLast vLast = Target.Value End If End If End Sub -- XL2002 Regards William "Raghunandan" wrote in message ... | Hi All, | I want to write a handler which will be called when the user changes the | contents of a cell and I need to get the value in this cell before | modification.Is there any way to do this? | | Thanks in advance | | Regards | Raghu | |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I cant do like that because there are chances that user can delete a row and
add the same in the last "William" wrote: Hi Raghu Is there any reason why you cannot use formulae in column A of the second sheet to relate to the relevant index in Column D of the first sheet? -- XL2002 Regards William "Raghunandan" wrote in message ... | Hi, | I think I was not clear enough.My requirement is like this.I have a | worksheet in which i need to implement 1 to many relationship between data.So | I maintain 2 sheets.The data relationship is somewhat like this | | 1st sheet: | | name description unique_id index | qwert qwerty 1 200 | 2nd sheet: | | index data | 200 asdf | 200 zxc | | if the user changes the index in 1st sheet,I need to go and change the | indexes in 2nd sheet | | I don't know how to do this | | Regards | Raghu | | "William" wrote: | | Hi Raghu | | The following sub (insert in the relevant worksheet module) will record any | changes made to cell A1 and place the value prior to changing in column F | and the time it was changed in column G. | | Private Sub Worksheet_Change(ByVal Target As Range) | Static vLast As Variant | If Target.Address = "$A$1" Then | If vLast < Target.Value Then | Range("F65000").End(xlUp).Offset(1, 1) = Now | Range("F65000").End(xlUp).Offset(1, 0) = vLast | vLast = Target.Value | End If | End If | End Sub | | -- | XL2002 | Regards | | William | | | | "Raghunandan" wrote in message | ... | | Hi All, | | I want to write a handler which will be called when the user changes the | | contents of a cell and I need to get the value in this cell before | | modification.Is there any way to do this? | | | | Thanks in advance | | | | Regards | | Raghu | | | | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
'Trick' to restore original sort order after data modified? | Excel Discussion (Misc queries) | |||
Switch to change data fields to 0's, then back to original data? | Excel Discussion (Misc queries) | |||
In adjacent cell, show last date modified of target cell. | Excel Discussion (Misc queries) | |||
Charts not recognizing source data if original linked data is changed. | Charts and Charting in Excel | |||
Auto save replaced my original file and now I need the original? | Excel Discussion (Misc queries) |