That made no sense what so ever but i use this to get the username of the perosn logged on to a computer:
'place this at the very top of any module
Private Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpbuffer As String, _
nsize As Long) As Long
'i place this in a userform_initialise but put it where you like
Dim lpbuff As String * 25
Dim ret As Long
Dim StrName As String
Dim StrSheet As String
StrSheet = FrmNew.CBAccType.Value
ret = GetUserName(lpbuff, 25)
StrName = Left(lpbuff, InStr(lpbuff, Chr(0)) - 1)
FrmNew.TxtKID.Value = StrName ' this line just populatd the userform but you could put it in a cell if you wanted
I hope that helps if not sorry buddy
Bookmarks