ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Allow certain users to edit certain rows? (https://www.excelbanter.com/excel-programming/312849-allow-certain-users-edit-certain-rows.html)

hay7777[_4_]

Allow certain users to edit certain rows?
 

Hi Geof,

Actually, my question was how to create different logins for differen
people - they won't access it concurrently.

Is there a built-in way, or do I have to pop up a form to ask for it?

Thanks!

Davi

--
hay777
-----------------------------------------------------------------------
hay7777's Profile: http://www.excelforum.com/member.php...fo&userid=1506
View this thread: http://www.excelforum.com/showthread.php?threadid=26693


Geof Wyght[_2_]

Allow certain users to edit certain rows?
 
David,
If you're on a network and if all your users have network
ids then this should work:
'Goes at the top of the module.
Declare Function GetUserName Lib "advapi32.dll"
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As
Long) As Long

Then get the id with:

Public Function GetCurrentUserName() As String

Dim lpBuff As String * 25
Dim ret As Long, Username As String

On Error GoTo Err_GetCurrentUserName

ret = GetUserName(lpBuff, 25)
'Username is global in scope.
Username = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
GetCurrentUserName = Username & ""

Exit_GetCurrentUserName:
Exit Function

Err_GetCurrentUserName:
MsgBox Err.Description
Resume Exit_GetCurrentUserName
End Function

Call GetCurrentUserName in the Workbook_Open event. Match
the name up to some hidden list. There's no prompting to
this call. No password either, though. If you want to get
that fancy and professional-looking, then yes, use a form.

If you're not on a network, make a logon form and match to
your hidden list.

The API call just saves the user from entering an id.
Geof.
-----Original Message-----

Hi Geof,

Actually, my question was how to create different logins

for different
people - they won't access it concurrently.

Is there a built-in way, or do I have to pop up a form to

ask for it?

Thanks!

David


--
hay7777
----------------------------------------------------------

--------------
hay7777's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=15066
View this thread:

http://www.excelforum.com/showthread...hreadid=266937

.



All times are GMT +1. The time now is 12:00 AM.

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