• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

Worksheet Switch event?


I know there is a worksheet change event. Is there an event to run when a worksheet is change (say when a user clicks from tab A to tab B?)

In my senario, user would enter data on A and then switch to B to see calculated data (using some VBA)

How would I go on to do this?

Is it possible to do this via worksheet change event?

4 Solutions
Saqib Husain, SyedEngineerCommented:
Private Sub Worksheet_Activate()
Anthony BerenguelCommented:
within the workbook
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'your code
End Sub

Open in new window

Saqib Husain, SyedEngineerCommented:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
NorieVBA ExpertCommented:
Each worksheet had a Deactivate and Activate event.

A workbook has the SheetActivate and SheetDeactivate event.

I suppose you could use those, or you could add to the existing code to activate Sheet B when Sheet A is changed.

To goto another  worksheet you can use this.
Application.Goto Sheets("SheetB").Range("A1")

Open in new window

This will goto A1 but you coould change the range to goto where the results will be found.
Shanan212Author Commented:
Thanks all!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now