View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default textbox to return User Name

Putting it in the change event wouldn't make much sense.

Change doesn't fire until you enter something in the textbox.

May put the code in

Private Sub Userform_Initialize() ' yes, userform, not userform1
UserForm1.TextBox1.Value = Application.UserName
End Sub

--
Regards,
Tom Ogilvy



"ADK" wrote in message
...
Like this:

Private Sub TextBox1_Change()
UserForm1.TextBox1.Value = Application.UserName
End Sub

It doesn't seem to show any result in the textbox


"Die_Another_Day" wrote in message
oups.com...
UserForm1.TextBox1.Value = Application.UserName

Note: I do not have Excel 2000 to test on. Tested in 2002 & 2003

Charles

ADK wrote:
If you can, how can I return the User Name in a TextBox on a UserForm.
User Name being the one in Excel|Options|General Tab|User Name:
(Excel 2000)

Thanks,

-ADK