Solved

Worksheet Switch event?

Posted on 2012-04-13
5
225 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

747 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

12 Experts available now in Live!

Get 1:1 Help Now