Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update fields?
Hi,
I wrote a function to get the current user's name: ' Get current user's name Public Function GetUser() As String GetUser = Environ("UserName") End Function It works fine on my computer, but other users say they had to double-click on the fields to make its content being updated. How can this be done within a macro? Thanks, Cannabibal |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update fields?
Have you tried:
GetUser=Application.Username "Cannabibal" wrote: Hi, I wrote a function to get the current user's name: ' Get current user's name Public Function GetUser() As String GetUser = Environ("UserName") End Function It works fine on my computer, but other users say they had to double-click on the fields to make its content being updated. How can this be done within a macro? Thanks, Cannabibal |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update fields?
Here iks an API way ro get the login name
Public Declare Function GetUserName Lib "advapi32.dll" _ Alias "GetUserNameA" _ (ByVal lpBuffer As String, _ nSize As Long) As Long Public Function UserName() As String Dim sName As String * 256 Dim cChars As Long cChars = 256 If GetUserName(sName, cChars) Then UserName = Left$(sName, cChars - 1) End If End Function The worksheet cell could then use =UserName() -- HTH RP (remove nothere from the email address if mailing direct) "gocush" wrote in message ... Have you tried: GetUser=Application.Username "Cannabibal" wrote: Hi, I wrote a function to get the current user's name: ' Get current user's name Public Function GetUser() As String GetUser = Environ("UserName") End Function It works fine on my computer, but other users say they had to double-click on the fields to make its content being updated. How can this be done within a macro? Thanks, Cannabibal |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
fields names do not show in excel 2007 pivot table fields list | New Users to Excel | |||
Keep data in fields if no update while updating | Excel Worksheet Functions | |||
[pivottables] multiple table selection fields update in one click... | Excel Discussion (Misc queries) | |||
Why don't fields update automatically when new numbers are input?. | Excel Discussion (Misc queries) | |||
Update fields with blanks | Excel Discussion (Misc queries) |