Solved

Directing a "Go To" statement in a Macro

Posted on 2013-01-06
5
222 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
  • 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

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
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…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

896 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

15 Experts available now in Live!

Get 1:1 Help Now