nbqleebarnes
03-19-2009, 04:40 AM
Hi All,
I have been busy with a login program and I am trying to give certain access to certain users.
I have multiple sheets and I wish to give for example user1 access to rows 1 through 80 and not the rest of the worksheet, and so on for each worksheet.
I have got the code as follows where I need to enter the code for the above mentioned, I would presume that "selected sheet hide range" in code would probably be the answer, but I'm not that good at VB yet.
Private Sub cmdOKBttn_Click()
If txtPassword.Value = "user" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
' I should imagine that the relevant code would be here somewhere?
ElseIf txtPassword.Value = "user1" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
ElseIf txtPassword.Value = "user2" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
ElseIf txtPassword.Value = "user3" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
ElseIf txtPassword.Value = "user4" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
If anyone one could help I would much appreciate it.
Cheers
Lee
I have been busy with a login program and I am trying to give certain access to certain users.
I have multiple sheets and I wish to give for example user1 access to rows 1 through 80 and not the rest of the worksheet, and so on for each worksheet.
I have got the code as follows where I need to enter the code for the above mentioned, I would presume that "selected sheet hide range" in code would probably be the answer, but I'm not that good at VB yet.
Private Sub cmdOKBttn_Click()
If txtPassword.Value = "user" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
' I should imagine that the relevant code would be here somewhere?
ElseIf txtPassword.Value = "user1" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
ElseIf txtPassword.Value = "user2" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
ElseIf txtPassword.Value = "user3" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
ElseIf txtPassword.Value = "user4" Then
frmPWord_AccessLevel.Hide
Sheet1.Select
If anyone one could help I would much appreciate it.
Cheers
Lee