Solved

Directing a "Go To" statement in a Macro

Posted on 2013-01-06
5
227 Views
Last Modified: 2013-01-06
EE Pros;

I have a WB that has four WSs.  All are hidden when the WB is opened except WS1.  Based on a choice on WS1, one of two other worksheets is opened (either WS2 or WS3). From either WS2 or WS3, a button directs WS 4 to be opened and used.  When finished with WS4, I want to return to WS 2 or 3 DEPENDING ON WHICH ONE IS OPEN (NOT HIDDEN).  While going to WS4 is easy, how I get a macro to determine which WS is open (WS 2 or 3) and go to it, while hiding again WS4 is not something I know how to do but would expect it needs an "if" Statement and a macro.

Any help would be most appreciated.

B.
0
Comment
Question by:Bright01
[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
  • 3
5 Comments
 
LVL 26

Assisted Solution

by:redmondb
redmondb earned 350 total points
ID: 38749004
Hi, Bright01.

I'm not sure I've correctly understood your requirements, but please see attached.

Regards,
Brian.
Appearances.xlsm
0
 
LVL 10

Assisted Solution

by:etech0
etech0 earned 150 total points
ID: 38749007
Do you have the rest of the code set up yet? If so, can you post it?

You'd probably need something like this:

If Worksheets("WS2").Visible then Worksheets("WS2").select
If Worksheets("WS3").Visible then Worksheets("WS3").select

Open in new window

0
 
LVL 26

Accepted Solution

by:
redmondb earned 350 total points
ID: 38749014
...and a small change so that selecting WS2 or WS3 from WS1 will hide the other sheet.Appearances-V2.xlsm
0
 

Author Closing Comment

by:Bright01
ID: 38749212
Great Teamwork!  Fast and accurate.

Much thanks,

B.
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38749627
Thanks, Bright01.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

688 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