Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to get the original data in a cell after it is modified

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default How to get the original data in a cell after it is modified

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to get the original data in a cell after it is modified

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
|



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default How to get the original data in a cell after it is modified

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
| |
|
|
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to get the original data in a cell after it is modified

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Trick' to restore original sort order after data modified? L Welker Excel Discussion (Misc queries) 4 April 3rd 23 04:17 PM
Switch to change data fields to 0's, then back to original data? mapleleafmike Excel Discussion (Misc queries) 0 July 8th 08 02:25 PM
In adjacent cell, show last date modified of target cell. manxman Excel Discussion (Misc queries) 0 March 17th 06 10:47 PM
Charts not recognizing source data if original linked data is changed. JLC Charts and Charting in Excel 3 October 14th 05 01:29 AM
Auto save replaced my original file and now I need the original? Hols Excel Discussion (Misc queries) 1 August 15th 05 10:34 PM


All times are GMT +1. The time now is 09:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"