View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
KRCowen KRCowen is offline
external usenet poster
 
Posts: 21
Default Capturing the selected tab in a worksheet_deactivate macro

The following should help

Private Sub Worksheet_Deactivate()
Dim s As Worksheet
Set s = ActiveSheet
'do your stuff here
s.Activate
End Sub

If any of your complex updating involves selecting sheet1 (or the sheet which
triggers this deactivate code) you could have a loop problem. Otherwise this
should put you on the sheet you selected which triggered the deactivation of
the sheet.

Good luck.

Ken
Norfolk, Va

ps Merry Christmas