Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 79
Default Code to hide sheets

Hi
I have a workbook for the time attendance in the main sheet there is
a
list of ID numbers with link
when ever you click on your ID"number" your sheet will open and than
you can
put how many hours y have worked each day
what i need is a way to hide those sheets from being seen but
whenever
you press on your name your sheet will be displayed. but each month i
have to access each sheet so i can add rows in it and add the date
and
the projects +sometimes i need to add sheets for new employees

I have used the following but it is for a value text not a number what
should i put instead ?

And can i put this file on shared ? and it will still work properly
and if not is there is any way ? to do this ?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ws As Worksheet
If Range("D1").Value = "Tia" Then Exit Sub
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing And _
Target.Row 1 Then
For Each ws In ThisWorkbook.Worksheets
If ws.Name < "Main" Then ws.Visible = False
Next ws
Sheets(Target.Value).Visible = True
Sheets(Target.Value).Select
End If
End Sub

Private Sub Workbook_Open()
Dim ws As Worksheet
If Sheets("Main").Range("D1").Value = "Tia" Then
For Each ws In ThisWorkbook.Worksheets
ws.Visible = True
Next ws
End If
End Sub

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
hide code does not hide Wanna Learn Excel Discussion (Misc queries) 2 March 6th 08 07:21 PM
code to hide hides too much Marilyn Excel Discussion (Misc queries) 4 January 25th 08 02:46 AM
Hide VBA code help GerryK Excel Worksheet Functions 3 May 30th 07 09:47 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
Hide Code tannersnonni Excel Discussion (Misc queries) 0 July 28th 05 01:06 AM


All times are GMT +1. The time now is 11:24 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"