Solved

Worksheet Switch event?

Posted on 2012-04-13
5
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 34

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

628 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