Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 59
Default User Name Automatically Populate

Hello,

Is there a way to automatically populate column Z with the user name who
puts text in column A?

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default User Name Automatically Populate

Hi,

Right click the sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then' Change to suit
Target.Offset(0, 25).Value = Environ("UserName")
End If
End Sub

Mike

"nabanco" wrote:

Hello,

Is there a way to automatically populate column Z with the user name who
puts text in column A?

Thank you

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default User Name Automatically Populate

Use this worksheet event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("a:a")
If Intersect(Target, r) Is Nothing Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row, "Z").Value = Environ("username")
Application.EnableEvents = True
End Sub
--
Gary''s Student - gsnu200752


"nabanco" wrote:

Hello,

Is there a way to automatically populate column Z with the user name who
puts text in column A?

Thank you

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 59
Default User Name Automatically Populate

Thank you, worked perfectly!

"Mike H" wrote:

Hi,

Right click the sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then' Change to suit
Target.Offset(0, 25).Value = Environ("UserName")
End If
End Sub

Mike

"nabanco" wrote:

Hello,

Is there a way to automatically populate column Z with the user name who
puts text in column A?

Thank you

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 59
Default User Name Automatically Populate

Hey Mike, we just ran the survey and something strange happened.

The user names only recorded through row 10. Everthing below that did not
return an user name. Is there something in the code that could be changed?
Trying to deliver a user name whenever a person puts text into the A colum,
even if it is A20000

Thank you

"Mike H" wrote:

Hi,

Right click the sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then' Change to suit
Target.Offset(0, 25).Value = Environ("UserName")
End If
End Sub

Mike

"nabanco" wrote:

Hello,

Is there a way to automatically populate column Z with the user name who
puts text in column A?

Thank you



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 59
Default User Name Automatically Populate

Hey Mike, we just ran the survey and something strange happened.

A user name only returned for rows 1-10. Is there any way to change it so
that a user name returns once aperson puts somethign into column A,
regardless of how far down in the sheet we are?

"Mike H" wrote:

Hi,

Right click the sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then' Change to suit
Target.Offset(0, 25).Value = Environ("UserName")
End If
End Sub

Mike

"nabanco" wrote:

Hello,

Is there a way to automatically populate column Z with the user name who
puts text in column A?

Thank you

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default User Name Automatically Populate

Look at the third line in Mike's code:

If Not Intersect(Target, Range("A1:A10")) Is Nothing Then' Change to
suit

He even tells you to change it to suit (the apostrophe indicates the
start of a comment).

Hope this helps.

Pete

On Oct 29, 4:25 pm, nabanco wrote:
Hey Mike, we just ran the survey and something strange happened.

A user name only returned for rows 1-10. Is there any way to change it so
that a user name returns once aperson puts somethign into column A,
regardless of how far down in the sheet we are?



"Mike H" wrote:
Hi,


Right click the sheet tab, view code and paste this in


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then' Change to suit
Target.Offset(0, 25).Value = Environ("UserName")
End If
End Sub


Mike


"nabanco" wrote:


Hello,


Is there a way to automatically populate column Z with the user name who
puts text in column A?


Thank you- Hide quoted text -


- Show quoted text -



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default User Name Automatically Populate

Change the Range("A1:A10") to Range("A:A")


Gord Dibben MS Excel MVP

On Mon, 29 Oct 2007 09:25:02 -0700, nabanco
wrote:

Hey Mike, we just ran the survey and something strange happened.

A user name only returned for rows 1-10. Is there any way to change it so
that a user name returns once aperson puts somethign into column A,
regardless of how far down in the sheet we are?

"Mike H" wrote:

Hi,

Right click the sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then' Change to suit
Target.Offset(0, 25).Value = Environ("UserName")
End If
End Sub

Mike

"nabanco" wrote:

Hello,

Is there a way to automatically populate column Z with the user name who
puts text in column A?

Thank you


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
Populate field automatically TJAC Excel Discussion (Misc queries) 1 January 17th 07 08:02 PM
Populate lists automatically New2XL Excel Discussion (Misc queries) 5 September 22nd 06 10:08 AM
Automatically Populate Fields tqdinh22 Excel Discussion (Misc queries) 1 July 17th 06 07:04 PM
Automatically Populate Fields tqdinh22 Excel Discussion (Misc queries) 0 July 17th 06 05:45 PM
how do you have information from one tab automatically populate i excel newbe Excel Worksheet Functions 2 January 19th 06 10:55 PM


All times are GMT +1. The time now is 02:32 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"