To get the user's logon name, use a VBA function like
Declare Function GetUserName Lib "advapi32.dll" Alias
"GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
Function GetLogonName() As String
Dim N As Long: N = 255
Dim S As String
S = String(N, " ")
GetUserName S, N
GetLogonName = Left(S, N - 1)
End Function
You can then call this from a cell with =GetLogonName()
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
message
news:
[email protected]...