Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 273
Default Visible tab threw drop down selection

Hello, I want to have a main tab that I would select an employees name from a
drop down list "The employee name would be the name of a tab" Then it would
make the tab visible then I would have a button to close or make it visible =
false again and only show the main screen where I need to select an employee.
How would I acomplish this?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 192
Default Visible tab threw drop down selection

One way to accomplish this is in three steps:

1. Create a validation list of employees using Data-Valication...
Under "Allow" select "List" and select the range of your employee names
2. Paste the following macro into VBA
This macro will hide the worksheet with the same name as what you have
selected in your validation drop-down list if it is visible and will unhide
it if it is not visible.
If your validation set is in "A1":

Sub HideUnhide()

Dim employee as Range

Set employee = Range("A1")

If Sheets(employee.value).Visible = True Then
Sheets(employee.Value).Visible = False
Else: Sheets(employee.Value).Visible = True
End If

End Sub

3. Assign this macro to a button or shortcut for easy use.

The macro is untested, but should work. Good luck!
--
-SA


"Chad" wrote:

Hello, I want to have a main tab that I would select an employees name from a
drop down list "The employee name would be the name of a tab" Then it would
make the tab visible then I would have a button to close or make it visible =
false again and only show the main screen where I need to select an employee.
How would I acomplish this?

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 192
Default Visible tab threw drop down selection

I'm pretty new to event programming, but if you paste the following in the
worksheet portion of the VBA editor (right click on the worksheet you want
the code an click "View Code") you don't have to run it per say each time you
select a new employee. It will do this automatically. Enjoy!

Private Sub Worksheet_Change(ByVal Target As Range)

Set Target = Range("B8")

If Sheets(Target.Value).Visible = True Then
Sheets(Target.Value).Visible = False
Else: Sheets(Target.Value).Visible = True
End If

End Sub
--
-SA


"StumpedAgain" wrote:

One way to accomplish this is in three steps:

1. Create a validation list of employees using Data-Valication...
Under "Allow" select "List" and select the range of your employee names
2. Paste the following macro into VBA
This macro will hide the worksheet with the same name as what you have
selected in your validation drop-down list if it is visible and will unhide
it if it is not visible.
If your validation set is in "A1":

Sub HideUnhide()

Dim employee as Range

Set employee = Range("A1")

If Sheets(employee.value).Visible = True Then
Sheets(employee.Value).Visible = False
Else: Sheets(employee.Value).Visible = True
End If

End Sub

3. Assign this macro to a button or shortcut for easy use.

The macro is untested, but should work. Good luck!
--
-SA


"Chad" wrote:

Hello, I want to have a main tab that I would select an employees name from a
drop down list "The employee name would be the name of a tab" Then it would
make the tab visible then I would have a button to close or make it visible =
false again and only show the main screen where I need to select an employee.
How would I acomplish this?

Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter drop-down is not visible Determined07 New Users to Excel 1 August 17th 07 04:03 AM
Excel sheet: selection of cell or rows not visible. Hisoul Excel Worksheet Functions 2 May 16th 07 09:06 PM
Create new drop down from previous drop down selection Supe Excel Discussion (Misc queries) 3 January 19th 07 10:26 PM
drop down selection determines other drop down content lskelton Excel Discussion (Misc queries) 1 November 1st 05 11:14 PM
Cell selection not visible Mangesh Yadav Excel Discussion (Misc queries) 1 September 1st 05 01:29 PM


All times are GMT +1. The time now is 01:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"