Add User Name to Comment

  • Thread starter Thread starter Angeles
  • Start date Start date
A

Angeles

Hi , how can I add the current User Name to comment ? I am using the line :

ActiveCell.AddComment ("Item was added on " & Str(Now))

I want to set :

ActiveCell.AddComment ("Attribute was added on " & Str(Now) " , it was added
by " )

Thank you
 
You can use Environ("username") something like this...

ActiveCell.AddComment ("Attribute was added on " & Str(Now) & _
" , it was added by " environ("username"))
 
ActiveCell.AddComment "Attribute was added on " & Str(Now) & _
Chr(10) & " it was added by " & Application.UserName

should work
 
This function call...

Environ("UserName")

will return the user name... just concatenate it where you want it to go.

Rick
 
It worked !

Thank you very much :)

john said:
ActiveCell.AddComment "Attribute was added on " & Str(Now) & _
Chr(10) & " it was added by " & Application.UserName

should work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top