ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add User Name to Comment (https://www.excelbanter.com/excel-programming/401935-add-user-name-comment.html)

Angeles

Add User Name to Comment
 
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

Jim Thomlinson

Add User Name to Comment
 
You can use Environ("username") something like this...

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


--
HTH...

Jim Thomlinson


"Angeles" wrote:

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


John

Add User Name to Comment
 
ActiveCell.AddComment "Attribute was added on " & Str(Now) & _
Chr(10) & " it was added by " & Application.UserName

should work
--
JB


"Angeles" wrote:

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


Rick Rothstein \(MVP - VB\)

Add User Name to Comment
 
This function call...

Environ("UserName")

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

Rick


"Angeles" wrote in message
...
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



Angeles

Add User Name to Comment
 
It worked !

Thank you very much :)

"john" wrote:

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

should work
--
JB


"Angeles" wrote:

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



All times are GMT +1. The time now is 08:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com