LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default compare data evolution

Many thanks Bob

"Bob Phillips" wrote:

Option Explicit

Private oldCell

Const kTarget As String = "H10"

Private Sub Worksheet_Activate()
oldCell = ActiveCell.Value
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Address(False, False) = kTarget Then
MsgBox "Was " & oldCell & ", and is now " & Target.Value
oldCell = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address(False, False) = kTarget Then
oldCell = Target.Value
End If
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--

HTH

RP
(remove nothere from the email address if mailing direct)


"Willow" wrote in message
...
Using the event Worksheet_Change, is that possible to compare the data in
cell before the change with the one which fire the macro ?
I'm running under Excel 97 !




 
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
Microsoft Responds to the Evolution of Online Communities Joe User[_2_] Excel Discussion (Misc queries) 62 May 17th 23 03:47 AM
Microsoft Responds to the Evolution of Online Communities [email protected] Excel Worksheet Functions 22 May 11th 10 03:40 AM
Update - Microsoft Responds to the Evolution of Community No Name Excel Discussion (Misc queries) 10 May 10th 10 07:47 PM
Update - Microsoft Responds to the Evolution of Community No Name New Users to Excel 0 May 8th 10 08:02 AM
Microsoft Responds to the Evolution of Online Communities No Name New Users to Excel 1 May 7th 10 02:34 PM


All times are GMT +1. The time now is 11:23 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"