Hide/lock worksheets

I have a workbook with 10 spreadsheets. Each sheet/tab is for individual 
employees. Is there a way to have a user sign in and only view their own tab 
and not gain access or even hide the other employees sheets/tabs?

0
Utf
1/7/2010 5:17:02 PM
excel.worksheet.functions 4936 articles. 2 followers. Follow

4 Replies
2831 Views

Similar Articles

[PageSpeed] 24

You can have a sign-in sheet that would display when the file is opened. 
You could then have a drop-down in a cell that would display all the names. 
The user would select a name (his own, presumably) and his sheet would be 
displayed.  But what is there to prevent him from selecting another name 
than his own?  Well, Excel could ask for a password.  All of this would be 
based on the sheets being VeryHidden, a concept that would require the user 
to have some knowledge of VBA programming to defeat.  But be aware that 
Excel is not built to be a secure platform.  To the casual user yes.  To the 
knowledgeable user, no.  Come back if you want to pursue this further.  HTH 
Otto

"McChas" <McChas@discussions.microsoft.com> wrote in message 
news:33B82EFE-407B-4988-B6EF-3A574C9A2A17@microsoft.com...
> I have a workbook with 10 spreadsheets. Each sheet/tab is for individual
> employees. Is there a way to have a user sign in and only view their own 
> tab
> and not gain access or even hide the other employees sheets/tabs?
> 
0
Otto
1/7/2010 5:36:53 PM
Hi,
Let's say sheet 1 can be access by user 1 so right click on the sheet1 tab, 
view code and there copy below code. Password is "MANAGER" you can copy the 
same code in all the other sheets and just change the password. Then hide the 
sheet and make a menu access like user name so when the user click on the 
button it will be asked for the password if the password is wrong will be 
returned to the main menu

Private Sub Worksheet_Activate()
Dim strPassword As String
On Error Resume Next
Me.Protect Password:="MANAGER"
Me.Columns.Hidden = True

strPassword = InputBox("Enter password to access DATA sheet")

If strPassword = "" Then
ActiveSheet.Visible = False
Worksheets("Menu").Select
Exit Sub
ElseIf strPassword <> "MANAGER" Then
MsgBox "Password Incorrect "
ActiveSheet.Visible = False
Worksheets("Menu").Select
Exit Sub
Else
Me.Unprotect Password:="MANAGER"
Me.Columns.Hidden = False
End If
Range("a1").Select
On Error GoTo 0
End Sub

Private Sub Worksheet_Deactivate()
On Error Resume Next
Me.Columns.Hidden = True
On Error GoTo 0
End Sub


When creating the Menu to access the file you can assign the macro as follow 
to the button

Sub Sheet1()
'
' Sheet1 Macro
'
Sheets("Menu").Select
    Sheets("Sheet1").Visible = True
    Sheets("Sheet1").Select

"McChas" wrote:

> I have a workbook with 10 spreadsheets. Each sheet/tab is for individual 
> employees. Is there a way to have a user sign in and only view their own tab 
> and not gain access or even hide the other employees sheets/tabs?
> 
0
Utf
1/7/2010 5:42:01 PM
Not too easily.  A really dedicated user can crack Excel's security.

Requires VBA code and some passwords or login names.

Sample code.......................

Note: the following is contingent upon users enabling macros.

If they don't only the "Dummy" sheet will be visible with a large message
stating "By disabling macros you have rendered this workbook unusuable.
Please close and re-open with macros enabled"

I assume you are on a network(LAN) with users logging into the system.

I would set it up so that whichever user's login name is flagged, all sheets
except that user would be hidden.

No password to open the workbook or sheet protection, just code to make a
user's sheet visible.

In the Thisworkbook Module....................

Private Sub Workbook_Open()
Dim pword As String
On Error GoTo endit
Select Case Environ("Username")

      'if a login is not used change to
      'pword = InputBox("Enter Your Password")
      'Select Case pword
      
      Case Is = "Gord": Sheets("Gordsheet").Visible = True
      Case Is = "Pete": Sheets("Petesheet").Visible = True
End Select
Sheets("Dummy").Visible = False
Exit Sub
endit:
'MsgBox "Incorrect Password"
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sht As Worksheet
Application.ScreenUpdating = False
       Sheets("Dummy").Visible = xlSheetVisible
           For Each sht In ActiveWorkbook.Sheets
           If sht.Name <> "Dummy" Then
      sht.Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub

To allow you to see all sheets and edit them.

In a general module...............

Sub UnHideAllSheets()
    Application.ScreenUpdating = False
    Dim n As Single
    For n = 1 To Sheets.Count
        Sheets(n).Visible = True
    Next n
    Application.ScreenUpdating = True
End Sub

Naturally you want all this code invisible to the users.

Right-click on the workbook/project in VBE and select VBAProject Properties
and "Lock project for viewing"

Enter a password.


Gord Dibben  MS Excel MVP

On Thu, 7 Jan 2010 09:17:02 -0800, McChas <McChas@discussions.microsoft.com>
wrote:

>I have a workbook with 10 spreadsheets. Each sheet/tab is for individual 
>employees. Is there a way to have a user sign in and only view their own tab 
>and not gain access or even hide the other employees sheets/tabs?

0
Gord
1/7/2010 5:42:33 PM
How much security do you need? Excel does possess adequate security features 
to stand-up to a medium-large security attack.

Some basic ideas that are possible:
a) have a macro copy one sheet from master workbook into a new workbook.
b) In VBE, set visible property of other user sheets to "xlSheetVeryHidden"

But again, these are very weak security. The safest bet would be to split up 
the workbook (See Ron's site for help on this: 
http://www.rondebruin.nl/copy6.htm) and then place them each into folders 
that only each user can access.
-- 
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"McChas" wrote:

> I have a workbook with 10 spreadsheets. Each sheet/tab is for individual 
> employees. Is there a way to have a user sign in and only view their own tab 
> and not gain access or even hide the other employees sheets/tabs?
> 
0
Utf
1/7/2010 5:50:03 PM
Reply:

Similar Artilces:

Hiding "0" values in pivot table
In a worksheet I have a listing of stock records with ItemNumber, Date, StockLocation and NumberOnStock. When I make simple Pivot Table with ItemNumber and StockLocation as rows and select a Sum of "NumberOnStock" I would like to hide rows where the sum is "0". But this does not seem to be possible. Tried to follow the guidelines in the Microsoft article: http://office.microsoft.com/en-us/assistance/HP051998791033.aspx#Hide%20zero%20values%20in%20a%20PivotTable%20report But no luck :-( Mogens You could use conditional formatting on these cells - highlight the cells,...

Hiding formuals in cells question
Hi. I was wondering if there was a way to hide the formulas in cells without protecting the sheet. I am making something for other teachers at my school and I want to hide the formulas so they won't mess anything up on the spreadsheet. Any help would be greatly appreciated. Thanks! Hi not without protecting the sheet but why is this a problem for you? -- Regards Frank Kabel Frankfurt, Germany "JP" <JP@discussions.microsoft.com> schrieb im Newsbeitrag news:ABFE07BF-6087-4E24-814A-03AF8863A633@microsoft.com... > Hi. I was wondering if there was a way to hide the fo...

Cells Locking up
Hello For some reason on all Excel documents that I open or create, when I just select a cell and move my cursor the sheet highlights wherever my cursor goes. I am unable to stop this and unable to close Excel or select anything from the Tool bars. The only way can close is through Task Manager. Is there some sort of setting that I have selected or is my Excel corrupt? Cheers This might seem an odd solution, but try clicking 1) your middle mouse button (we have the same at work with drive problems) 2) at the bottom; near the sheets tabs (I've seen this before when i loads the ...

hide my name
When replying to an email or creating one from scratch how do i hide my name in the "from" field...thx fred <fdbjrgetridofthis@wowway.com> wrote: > When replying to an email or creating one from scratch how do i hide > my name in the "from" field...thx Are you saying you want the reply to be anonymous? -- Brian Tillman [MVP-Outlook] no, I don't mind if my email is revealed.. just my name. I have tried by removing it from the "User Name:" field in the email account but it continues to show up. I have also removed from the header informati...

Emailing a Worksheet
Is it possible to email a single worksheet in such a way that th recepient can make changes to the worksheet and send it back to me? I so, can I then replace the existing worksheet with the revise worksheet I receive back? Thanks for any help. (I'm looking to avoi having to send an entire workbook -- Message posted from http://www.ExcelForum.com Hi have a look at the following site for some example code http://www.rondebruin.nl/sendmail.htm#Sheet -- Regards Frank Kabel Frankfurt, Germany > Is it possible to email a single worksheet in such a way that the > recepient can make...

Put Active Worksheet's Name in a Cell #3
Is there a way to put the active worksheet's name in the cell? Not the file name of the whole workbook, just the name of the currently selected sheet. Thanks for your help. Hi Corey, There are a few ways this can be done using either macros or functions, here's one of each: *=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1, LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1))) (sourced from Chip Pearson's site, http://www.cpearson.com/excel/excelF.htm) I recommend checking this page out as it also shows ot...

Hiding and Un-Hiding Data fields
I am using a form for people to select data via dropdown menus and then having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then...

How do I hide gaps in an Excel 2007 chart?
I have a bar chart that is showing gaps and i don't want them. The select data > hidden and empty cell button does not give an option to hide gaps. I think by default they are hidden but if you even click on this to see what it does the gaps are shown and no way to turn off. Hi, If you hide the actual rows then with the Plot visible cells only setting on the gaps will be removed. In xl2007 the setting is on the Select Data dialog, Hidden/empty cells button. Cheers Andy Waynesch wrote: > I have a bar chart that is showing gaps and i don't want them. The s...

31k file that locks Outlook to servers
Is there a way to fix Outlook, so it doesn't lock onto the email server when it encounters the 31k spam email file with bad headers and virus attachment? Or is there a way to get it to log off? I know the spam message is common knowledge with web service providers, and the lock up, but I'd like to fix Outlook soon or switch to another email client if it can't be fixed. ...

Hiding a worksheet #3
I want to hide a worksheet. So, I went to the format menu and the "worksheet" option is grayed out. Why? And, how do I "ungray" it. Hi is your worksheet protected ? -- Regards Frank Kabel Frankfurt, Germany llong wrote: > I want to hide a worksheet. So, I went to the format menu and the > "worksheet" option is grayed out. Why? And, how do I "ungray" it. I think Frank meant to ask about the Workbook--not the worksheet. (Check under Tools|protection|Protect workbook or Unprotect workbook) My question is: Is there another sheet in the w...

Hide images when Hiding Rows
I have inserted images into cells, but when I hide the column the images are not hidden with that column, they just get squished between the two cells next to the hidden cell. Is there a setting or way to tie the image to that cell so that it hides/unhides appropriately with the row? -- kurt ------------------------------------------------------------------------ kurt's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=35686 View this thread: http://www.excelforum.com/showthread.php?threadid=554712 Kurt You cannot insert an image into a cell. You can overlay ...

how to hide an ActiveX control?
hi there i have an ActiveX control, written in C++, which has the OLEMISC_INVISIBLEATRUNTIME flag set, yet when i display the web page it is attached to, i get the familiar "red cross" graphic in the middle of the screen - how can i hide the control so nothing is displayed at all? tia bhu can u set the size of ur control as 1x1 pixels "bhu Boue vidya" <bhuvidya@yahoo.com.au> wrote in message news:1175703214.292931.252210@e65g2000hsc.googlegroups.com... > > hi there > > i have an ActiveX control, written in C++, which has the > OLEMISC_INVISIBLEATR...

Copying and numbering worksheets
I am trying to set up a new purchase ordering system using Excel. I am trying to set up a macro which will copy the master worksheet and number it as the next PO is needed. We have a separate workbook for each job and PO's are listed as XY-001, XY-002 ,... ...

Hiding plot Area
I have a formatted output sheet that has a Pie Chart embedded. The data for the pie chart comes from a second sheet using 2 ranges B2:B6 & D2:D6 B2:B6 is always populated and contains labels. What I want to do is, when D2:D6 contains 0 in each cell (or Null), suppress the Pie chart but always show the Legend (which is driven by B2:B6) Many Thanks Adam Adam - All you see of the pie when all values are zero is a single line at the first slice. The legend still appears. To hide the line, double click on one of the wedges and on the Patterns tab, change the Border setting to None. ...

print 2 worksheets on the same page side-by side
I am creating a template that has two worksheets, I need to print the worksheets on the same page side-by-side. The problem I am having with them on the same page is when I hide the rows with zero values on one side it hides the the numbers on the other side You have a response at your other thread. wil4d wrote: > > I am creating a template that has two worksheets, I need to print the > worksheets on the same page side-by-side. The problem I am having with them > on the same page is when I hide the rows with zero values on one side it > hides the the numbers on the other s...

Hiding rows with VBA
Hi all, In my sheet called "insertsheet I have this VBA: (thanks to some users of Google groups) Private Sub Worksheet_Change(ByVal Target As Range) Const nMAX As Long = 10 Dim nRows As Long Application.ScreenUpdating = False With Me With .Range("B8") If Intersect(Target(1), .Cells) Is Nothing Then Exit Sub nRows = .Value End With .Range(.Cells(1, 5), .Cells(1, _ .Columns.Count)).EntireColumn.Hidden = True .Range(Cells(1, 5), .Cells(1, _ ...

Summing up data from various worksheets
I have daily data all on different worksheets (31 in total) and I would like to add up all of the data in these worksheets in a monthly compilation I have so far been using the =sum('jan. 1'!B6, 'jan. 2'!B6 ... etc.) which although is effective is very time consuming is there an easier way to sum up all of the b6 cells without entering them individually? Thanks -- mark_vi_ ------------------------------------------------------------------------ mark_vi_'s Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24507 View this thread: http://www.excelf...

Locking a view
I am looking to place some security on a particular view within the crm. ex. I have a Shipping view and I only want the shipping clients to be able to access the view. How is this possible within CRM. If you create a team, you can assign the team to the view and then only those in the team will see the view. Linda Dienberg Microsoft CRM Certified Instructor/Professional ICS Advantage 630-566-8386 >-----Original Message----- >I am looking to place some security on a particular view >within the crm. ex. I have a Shipping view and I only >want the shipping clients to b...

hiding rows
I have data in cells A7:DK394 which all have 0 in them until totals are added in other worksheets which then pullthrough. At the end of the week I have to Hide all rows from A7 to A394 that still have 0 in them as no totals have been added in other sheets so the customer has not posted with us. is there any way excell can recognise the cells that have no data against them and hide them automatically by pressing a button. or if they all start off hidden unhide as data is entered. Hopefully this makes sense many thanks for any help with this as again its to save me lots of...

Outlook-hiding recipients addresses
How do you send a mailing to a distribution list without exposing their email addresses to the other recipients? Put the DL name in the BCC field and put your own address in the TO field. anonymous@discussions.microsoft.com wrote: > How do you send a mailing to a distribution list without > exposing their email addresses to the other recipients? ...

Hide contacts
I must hide some contacts from GAL excepted for 2 user that must to see them and select to send email. If only 2 users need a Contact, why not have them create it in their Contacts folder? -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- "MauroR" <MauroR@discussions.microsoft.com> wrote in message news:DAC0E2E9-7389-49F0-8736-3B9251DBB274@microsoft.com... >I must hide some contacts from GAL excepted for 2 user that must to see >them > and select to send email. Th...

How do I hide email addresses in outgoing mail
Hint: You post your question in the body of the post, not the Subject. Hint 2: Use the BCC field. -- Russ Valentine [MVP-Outlook] "Dennis" <Dennis@discussions.microsoft.com> wrote in message news:B2C2A70C-6C94-4688-8BAF-0A50AC9C142D@microsoft.com... > "Dennis" <Dennis@discussions.microsoft.com> wrote in message news:B2C2A70C-6C94-4688-8BAF-0A50AC9C142D@microsoft.com... > PLEASE write your question in the body of the post and NOT just the subject Have a look here: http://dts-l.net/goodpost.htm As posted here MANY MANY times - put them in the BCC...

locked LDB FILE
When exiting my MsAccess database I've noticed that the LDB File doesn't go away as it should. when I tried to delete the ldb file ( I'm the only one using it ) it says record locked. I tried rebooting - No Dice. I'm at my wits end trying to figure this out Have already done that - incidentally - I am the LAN man "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message news:04235949-AE2C-42A0-A58D-657FD4DC4371@microsoft.com... > Backup your database. Then do a Compact and Repair. > If it still does not go away then ask you LAN man t...

Can I Hide a Field?
I'm wanting to hide a field on a form (products form in this case) for some users but not for other users. Is this possible? For example, can I hide the product cost (wholesale) of an item for the salesperson, but not for the CEO? -- Brandon IT Director Office Equipment & Supplies at http://www.presentationsdirect.com Hi Brandon, You cannot have different formlayouts for different users/Teams at this time... Regards, Michael Randrup "Brandon S." <bsmith@presentationsdirect.nospam.com> wrote in message news:e4pDiMrYDHA.1620@TK2MSFTNGP12.phx.gbl... > I'm ...

Excel 2007 Files Being Locked on 2000 Server With Vista Clients?
Ok I have several users that are running Vista on their mahcine and running Excel 2007. They are saving their Excel 2007 files on a Windows 2000 Server and when they go back to open some of them they get a error. The Error says that " this file is locked for editing" and you only have ready only access. Now allot of times it shows the username who has the file locked and most of the time its the person that created the file. Even if I go try to open and I have full Admin rights I still get the same error. It seems this happens more with our users that have Vista running on t...