Solved

Worksheet Switch event?

Posted on 2012-04-13
5
232 Views
Last Modified: 2012-04-13
Hi,

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?

Thanks!
0
Comment
Question by:Shanan212
5 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 400 total points
ID: 37844243
Private Sub Worksheet_Activate()
0
 
LVL 10

Assisted Solution

by:Anthony Berenguel
Anthony Berenguel earned 50 total points
ID: 37844252
within the workbook
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'your code
End Sub

Open in new window

0
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 400 total points
ID: 37844263
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
0
 
LVL 33

Assisted Solution

by:Norie
Norie earned 50 total points
ID: 37844479
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.
0
 
LVL 13

Author Closing Comment

by:Shanan212
ID: 37844564
Thanks all!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now