View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default worksheet protection

of course the user could disable macros and this would all be for naught. -
just a thought.

--
Regards,
Tom Ogilvy

steve wrote in message
...
David,

There are any number of ways to do this:

In the ThisWorkbook module you can have a Worksheet_Activate event
that will call
myuser = Application.UserName
If Ucase(myuser) = Ucase("david") then
Activesheet.Unprotect "password"
End If

You will have to build in a list of user names and sheet names to make it
user
and sheet specific.

Or you could call an input box to supply a password
pswrd =InputBox("Enter Password")
If pswrd ="Xyz" and Activesheet.Name="usernameXyz"
Watch for uppercase and lower case. (check my first example to avoid that
trap).

You can also build a Select Case to include all of your users and their
page.

Select Case Activesheet.Name
Case Sheet1
pswrd = "abc"
Case Sheet2
pswrd = "efg"
Case Sheet3 ..............

Remember to protect your VBA to prevent people seeing the passwords and
messing with your code (not perfect since Excel is not that secure).

Hope this gives you a place to start...

steve

"david" wrote in message
...
I have a workbook that is going to be given to multiple
people. I want all of them to be able to look at all of
the pages, but then only be able to change information on
their page. I have pull down lists on the worksheets that
won't lock. How can I get all of these things to work? I
have no problem with assigning separate passwords per
sheet. I just need to know how to get it to work right.

Thanks,
David