?
Solved

Directing a "Go To" statement in a Macro

Posted on 2013-01-06
5
Medium Priority
?
228 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 1400 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 600 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 1400 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

Industry Leaders: 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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

741 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