English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a hyper link from "Sheet 1" that links to a hidden "Sheet2"....I used a VB Code....My question is: Is there anyway to add to that code so that once I have linked to the hidden sheet (which the VB Code unhides), is there a way to automatically have the "Sheet2" get hidden again when i navigate away from the sheet?...Please Help

2007-12-18 03:16:56 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

So add that code at the end of current code?

2007-12-18 03:37:08 · update #1

4 answers

Hi

Princess has the right idea, but I think your question involves how does Excel know when you have navigated away.

Excel watches for "events" to happen. Certain events can be used to trigger your code.

When you are in the Excel visual basic editor, search for this topic in help
Using Events with Microsoft Excel Objects

There are several different events that you can use. Pick the one that suits you.

-Jim Gordon
Microsoft Mac MVP

MVPs are independent and do not work for Microsoft
http://mvp.support.microsoft.com/

2007-12-18 13:44:32 · answer #1 · answered by jimgmacmvp 7 · 0 0

You haven't really explained in detail what is going on, but there are several ways to approach this problem. In order to know that Sheet2 has been "deactivated" you are going to need to use either the Worksheet_Deactivate event in the Sheet2 module, or the Workbook_SheetDeactivate event in the ThisWorkbook module. Probably the best would be to use the ThisWorkbook module. You check to see if the active sheet is named Sheet2 and if other conditions are present and then you hide Sheet2. The code would look like this:

Private Sub Workbook_SheetDeactivate (ByVal Sh As Object)
If Sh.Name = "Sheet2" Then
Sh.Visible = xlVeryHidden
End If
End Sub

Note that I am only testing to see if the active sheet is named "Sheet2." You may want to test for other conditions as well. This event will fire every time a worksheet in this workbook gets deactivated.

Tim
http://www.tvmcalcs.com

2007-12-18 17:24:53 · answer #2 · answered by Tim 4 · 0 0

hi the problem-unfastened thank you to do it fairly is to characteristic a "do no longer coach me this lower back" tick field on the backside of the message variety. once you person clicks this you could write to the person's registery to checklist this action. Then verify this merchandise in the previous you open the variety - this is set to actual then do no longer coach the instructions. you're able to upload it to the current_user area of the registry in any different case different customers might have this cost set for them in the previous they have even considered the message. i desire this facilitates Clayton

2016-11-03 22:58:18 · answer #3 · answered by hurlbut 4 · 0 0

use this code:

sheet2.activate
sheet2.visible = xlveryhidden

2007-12-18 03:28:22 · answer #4 · answered by princessil0523 4 · 0 0

fedest.com, questions and answers