Worksheet is no longer the active sheet Event

T

Todd Huttenstine

Hey guys

I do not know what event this would be but I need to put a
code in an event to where if the user selects another
sheet OR clicks on another application on the taskbar OR
hits ALT TAB and choses another application. Like a
worksheet lose focus event?


Thanks
Todd Huttenstine
 
C

Chip Pearson

Todd,

There is no event indicating that Excel is no longer the active
application. For switching between worksheets, see the Activate
and Deactivate events of the Worksheet.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
T

Todd Huttenstine

man...

What are these 2 events for?

Private Sub App_WorkbookDeactivate(ByVal Wb As Workbook)
MsgBox "Losing Focus"
End Sub

Private Sub Workbook_WindowDeactivate(ByVal Wn As
Excel.Window)
MsgBox "Losing Focus"
End Sub
 
C

Chip Pearson

The App_WorkbookDeactivate event occurs when you switch from one
workbook to another, i.e., when the ActiveWorkbook changes its
reference.

The WindowDeactivate event occurs when you switch from one window
to another. Remember, a Workbook can have several windows, so
this event may occur even with the App_WorkbookDeactivate does
not.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Top