Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I want to do the following: A) When I move away from a cell - ie by tabbing or moving with mouse - I want to be able to check the contents of the previously selected cell. B) When I move away from a cell - as above - I want to be able to check the contents of the cell moved to. So I need a BeforeMoveAway event and a JustMovedToCell event or similar. Can anyone help because I am finding this tricky Angus Comber |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Angus,
Use the SelectionChange event procedure. Put the following code in the code module for the appropriate worksheet. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Static PrevRange As Range If Not PrevRange Is Nothing Then MsgBox "PrevRange: " & PrevRange.Address & vbCrLf & _ "Current Range: " & Target.Address End If Set PrevRange = Target End Sub PrevRange will refer to the cell that was selected before changing the selection, and Target will refer to the currently selected range. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Angus Comber" wrote in message ... Hello I want to do the following: A) When I move away from a cell - ie by tabbing or moving with mouse - I want to be able to check the contents of the previously selected cell. B) When I move away from a cell - as above - I want to be able to check the contents of the cell moved to. So I need a BeforeMoveAway event and a JustMovedToCell event or similar. Can anyone help because I am finding this tricky Angus Comber |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel not responding | Charts and Charting in Excel | |||
Cell change events | Excel Discussion (Misc queries) | |||
Cell is not responding to wordtext | Excel Worksheet Functions | |||
Events with cell link | Excel Programming | |||
Events for cell deletion | Excel Programming |