ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   access specific areas of a protected worksheet (https://www.excelbanter.com/excel-programming/339202-access-specific-areas-protected-worksheet.html)

shital shah

access specific areas of a protected worksheet
 
Hi to all

I have Protected one Excel File which is open by more than 3 person. What i
want to do is there any way that if 1st person can open file than he can
only make change in column A to M only and if 2nd person can open that file
than he can only make changes in column N to AA. and 3d person can open that
file can only make changes in column AB to AG.

I am useing Excel 2000 any Help.
Thanks
****al

gearoi[_8_]

access specific areas of a protected worksheet
 

Make them press a button according to who they are. Put a macro behin
that button that unprotects the particular bit you want them to be abl
to change. Then make an automatic macro run on the close event for th
workbook (look up further stuff on events) basically write this int
your code in the workbook bit in the project explorer:

Private Sub Workbook_BeforeClose(Cancel As Boolean)

' make it re-protect here.

End Sub

If you don't trust them to press the right button then maybe you ca
make them login to excel or something, use an inputbox and find out wh
they are via a username (hard code it probably easiest), then you ca
add a password if they are total muppets to make it even safer. Ther
must be a hundred ways of making sure of this I imagine

--
gearo
-----------------------------------------------------------------------
gearoi's Profile: http://www.excelforum.com/member.php...fo&userid=2657
View this thread: http://www.excelforum.com/showthread.php?threadid=40191


Mike Fogleman

access specific areas of a protected worksheet
 
Give each user a specific password to enter and unlock their "area" using
your password on the sheet. Run this on the Workbook Open Event and relock
the cells on Workbook Close event.
In This Workbook code module:

Private Sub Workbook_Open()
Password
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Worksheets("Sheet1").Unprotect Password:="yourpassword"
Columns("A:AG").Locked = True
Worksheets("Sheet1").Protect Password:="yourpassword"
End Sub

In a General code module:

Sub Password()
Dim pswrd

pswrd = InputBox("Enter Password")
If pswrd = "user1" Then
Worksheets("Sheet1").Unprotect Password:="yourpassword"
Columns("A:M").Locked = False
Worksheets("Sheet1").Protect Password:="yourpassword"
ElseIf pswrd = "user2" Then
Worksheets("Sheet1").Unprotect Password:="yourpassword"
Columns("N:AA").Locked = False
Worksheets("Sheet1").Protect Password:="yourpassword"
ElseIf pswrd = "user3" Then
Worksheets("Sheet1").Unprotect Password:="yourpassword"
Columns("AB:AG").Locked = False
Worksheets("Sheet1").Protect Password:="yourpassword"
End If
End Sub

Mike F
"****al shah" wrote in message
...
Hi to all

I have Protected one Excel File which is open by more than 3 person. What
i
want to do is there any way that if 1st person can open file than he can
only make change in column A to M only and if 2nd person can open that
file
than he can only make changes in column N to AA. and 3d person can open
that
file can only make changes in column AB to AG.

I am useing Excel 2000 any Help.
Thanks
****al





All times are GMT +1. The time now is 09:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com