LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Multiple Password

Perhaps something such as this...

Public Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function ReturnUserName() As String
' returns the NT Domain User Name
Dim rString As String * 255, sLen As Long, tString As String
tString = ""
On Error Resume Next
sLen = GetUserName(rString, 255)
sLen = InStr(1, rString, Chr(0))
If sLen 0 Then
tString = Left(rString, sLen - 1)
Else
tString = rString
End If
On Error GoTo 0
ReturnUserName = LCase(Trim(tString))
End Function

Sub Filt()
Application.ScreenUpdating = False
On Error Resume Next
Dim Number As Integer

Range("J1").Select
Selection = "=ReturnUserName()"
If Range("J1").Text = oprince Or Range("J1").Text = hsmith = Then '< -- this
shows 2 user's login IDs
Number = 2 'this can be whatever you desire
Else
MsgBox ("Unauthorized.")

Exit Sub
End If

' blah, blah, blah, (I user the filter tool to find all criteria that
matched the value 2)

End Sub

I found the function, I think on this DG, a short time ago. I matched the
results of the function with the Sub and got this working later in the
afternoon yesterday.

Hope that helps,
Ryan---

--
RyGuy


"revdeacon" wrote:

Is it possble for one Workbook to have more than one password?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
password protect multiple spreadsheets in a workbook WORKSHEET PROTECTION Excel Worksheet Functions 3 October 26th 06 07:06 PM
password protect multiple worksheets in excel [email protected] Excel Discussion (Misc queries) 3 August 8th 06 10:31 PM
Admin Password for multiple workbooks richard pabey Excel Discussion (Misc queries) 1 August 8th 06 04:44 PM
Cell Password Protection-Multiple Worksheets GW Trainer Excel Worksheet Functions 0 May 19th 05 07:58 PM
Multiple Passwords and Maste Password Lucas Excel Discussion (Misc queries) 1 April 2nd 05 10:24 PM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"