Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Lost Focus

Is there a "lost focus" or change event in Excel? I want
to launch some code when a user exits a particular cell.

I have looked at the other similar questions in this
particular newsgroup and they are not helpful. Any
additional insights would be greatly appreciated.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Cell Lost Focus

use the default sheet's SelectionChange event. the parameter is the new
cell's address, however, if you save this into a public variable, it will
become the moved from cell at the next change. Just set up the open event to
select say A1 which will fire the event & populate the variable

Example:copy this code to the active sheet's code page:

Option Explicit
Public LastCell As String
Private Sub Worksheet_Deactivate()
Application.StatusBar = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.StatusBar = "FROM:" & LastCell & " TO" & Target.Address
LastCell = Target.Address
End Sub
--
Patrick Molloy
Microsoft Excel MVP
----------------------------------
"Craig" wrote in message
...
Is there a "lost focus" or change event in Excel? I want
to launch some code when a user exits a particular cell.

I have looked at the other similar questions in this
particular newsgroup and they are not helpful. Any
additional insights would be greatly appreciated.

Thanks.



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
Disable cell focus [email protected] Excel Discussion (Misc queries) 1 April 26th 09 12:04 AM
Active Cell/Focus Rich W. Excel Discussion (Misc queries) 6 March 19th 08 04:59 PM
Temporary formatting of cell with focus Ricter Excel Discussion (Misc queries) 5 August 31st 06 12:47 AM
Outline color of cell that has focus RobertC Excel Discussion (Misc queries) 1 July 15th 05 02:40 PM
Highlight Cell on Focus Nigel Graham Excel Programming 4 July 23rd 03 03:39 AM


All times are GMT +1. The time now is 07:56 PM.

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

About Us

"It's about Microsoft Excel"