View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Joergen Bondesen Joergen Bondesen is offline
external usenet poster
 
Posts: 110
Default What was ActiveSheet before changed to new sheet?

Hi Tom

Main sheet: right clik on tab - View Code and place below.

Take a close look at the 2 arrows. Left: Object and right: Procedure.


Option Explicit

Private Sub Worksheet_Deactivate()
MsgBox Me.Name
End Sub


Enjoy
--
Best Regards
Joergen Bondesen


"Tom L" wrote in message
...
I've been searching for hours, can't find a solution but it's probably
simple...how can I tell what sheet was the ActiveSheet BEFORE they changed
to the current activesheet.

Example: User is on a particular sheet (let's say they're on "Main"),
then they click the tab to go to the "Prices" sheet. How can I tell what
sheet they're comming FROM - in this case the "Main" sheet? In the
Workbook and the Worksheet events Activate and Deactivate, I check the
Sheet parameter (SH) and it always shows "Prices", the sheet they're going
too.

Thanks for your help!