The worksheet_deactivate event works like worksheet_afterdeactivate event.
How do i trap the worksheet_beforeDeactivate event?
The worksheet_deactivate event works like worksheet_afterdeactivate event.
How do i trap the worksheet_beforeDeactivate event?
It actually depends upon what you want to do. When Deactivate fires, the
active sheet is the new target sheet, but the Sh argument still points at
the old one, so you can do something like
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Dim this As Worksheet
On Error GoTo wb_exit
Application.EnableEvents = False
Set this = ActiveSheet
Sh.Activate
'do your stuff
this.Activate
wb_exit:
Application.EnableEvents = True
End Sub
--
HTH
RP
(remove nothere from the email address if mailing direct)
"OKLover" <[email protected]> wrote in message
news:[email protected]...
> The worksheet_deactivate event works like worksheet_afterdeactivate event.
> How do i trap the worksheet_beforeDeactivate event?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks