Thread: user access
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Simon Lloyd[_219_] Simon Lloyd[_219_] is offline
external usenet poster
 
Posts: 1
Default user access


Sathisc;338155 Wrote:
Hi,

currently we are using a shared excel of about 15 people. I want to
give sheet 3 to only 3 users. Is there any way we can share that
particular sheet for only those 3 users.

Many thanks for the helpDid i answer your other question satifactory?


This again has to be done with vba, this goes in the worksheet code
module:


*How to Save a Worksheet Event Macro*
1. *Copy* the macro using *CTRL+C* keys.
2. Open your Workbook and *Right Click* on the *Worksheet's Name Tab*
for the Worksheet the macro will run on.
3. *Left Click* on *View Code* in the pop up menu.
4. *Paste* the macro code using *CTRL+V*
5. Make any custom changes to the macro if needed at this time.
6. *Save* the macro in your Workbook using *CTRL+S*



Code:
--------------------
Private Sub Worksheet_Activate()
If Environ("username") < "Simon" Or Environ("username") < "Sathsic" Then
MsgBox "You are not authorised to view this sheet"
Sheets("Sheet2").Select
End If
End Sub
--------------------
It looks for the windows logon name, so in this instance mine would be
Simon and yours Sathsic (but naturally it will be our actual PC logon
names), you can just keep extending the terms using OR like i have.


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=94577