Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Capture user name

Hello,
I have this statement in macro that insert the date in a cell anytime
someone makes a change within a given row:

If Intersect(Target, Columns("G:R")) Is Nothing Then
Exit Sub
End If
n = Target.Row
Cells(n, "U").Value = Format(Now, "mm-dd-yyyy")
End Sub

I'd also like it to capture the username and input it in the same cell --
what do I need to do add to this statement to make that happen? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Capture user name

try this line

Cells(n, "U").Value = Environ("Usernme") & " " & Format(Now, "mm-dd-yyyy")

--


Gary


"Kamran" wrote in message
...
Hello,
I have this statement in macro that insert the date in a cell anytime
someone makes a change within a given row:

If Intersect(Target, Columns("G:R")) Is Nothing Then
Exit Sub
End If
n = Target.Row
Cells(n, "U").Value = Format(Now, "mm-dd-yyyy")
End Sub

I'd also like it to capture the username and input it in the same cell --
what do I need to do add to this statement to make that happen? Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Capture user name

sorry had a misspelling

Cells(n, "U").Value = Environ("Username") & " " & Format(Now, "mm-dd-yyyy")

--


Gary


"Kamran" wrote in message
...
Hello,
I have this statement in macro that insert the date in a cell anytime
someone makes a change within a given row:

If Intersect(Target, Columns("G:R")) Is Nothing Then
Exit Sub
End If
n = Target.Row
Cells(n, "U").Value = Format(Now, "mm-dd-yyyy")
End Sub

I'd also like it to capture the username and input it in the same cell --
what do I need to do add to this statement to make that happen? Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Capture user name

Great, that did it. Thanks.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture user ID... Doolee Excel Discussion (Misc queries) 2 March 24th 08 07:20 PM
Capture user input into xldialog print vpanang Excel Programming 3 April 27th 06 09:45 PM
Capture the range a user selects and put in textbox. Drew[_9_] Excel Programming 2 March 31st 06 04:02 PM
How to capture when a User changes the printer Jacob Excel Programming 1 February 23rd 06 07:59 PM
How to capture user ID in Excel macro? Ivan Excel Programming 1 May 26th 05 09:49 AM


All times are GMT +1. The time now is 07:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"