Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Enter a User Name When Changes are Made

I have a spreadsheet that is shared and there can be up to 12 people using it
at the same time. The Column A is Work Order number and Column H is Submitted
By. I want to have the spreadsheet automatically fill in the Submitted By
cell when a Work Order is entered into Column A. Is this possible?
Thanks for any help!
M
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Enter a User Name When Changes are Made

Insert the following worksheet event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a = Range("A:A")
If Intersect(t, a) Is Nothing Then Exit Sub
Application.EnableEvents = False
t.Offset(0, 7).Value = Environ("username")
Application.EnableEvents = True
End Sub

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200796


"chickalina" wrote:

I have a spreadsheet that is shared and there can be up to 12 people using it
at the same time. The Column A is Work Order number and Column H is Submitted
By. I want to have the spreadsheet automatically fill in the Submitted By
cell when a Work Order is entered into Column A. Is this possible?
Thanks for any help!
M

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Enter a User Name When Changes are Made

I'm getting a compile error with another part of my VB code.
M


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
If IsNumeric(Target) Then
Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy")
End If
End If
endit:
Application.EnableEvents = True
End Sub


"Gary''s Student" wrote:

Insert the following worksheet event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a = Range("A:A")
If Intersect(t, a) Is Nothing Then Exit Sub
Application.EnableEvents = False
t.Offset(0, 7).Value = Environ("username")
Application.EnableEvents = True
End Sub

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200796


"chickalina" wrote:

I have a spreadsheet that is shared and there can be up to 12 people using it
at the same time. The Column A is Work Order number and Column H is Submitted
By. I want to have the spreadsheet automatically fill in the Submitted By
cell when a Work Order is entered into Column A. Is this possible?
Thanks for any help!
M

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Enter a User Name When Changes are Made

There can be only one change event macro on a given sheet. So....we must
combine your logic with mine:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
If IsNumeric(Target) Then
Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy")
Target.Offset(0, 7).Value = Environ("username")
End If
End If
endit:
Application.EnableEvents = True
End Sub

REMEMBER: erase the older versions.

--
Gary''s Student - gsnu200796


"chickalina" wrote:

I'm getting a compile error with another part of my VB code.
M


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
If IsNumeric(Target) Then
Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy")
End If
End If
endit:
Application.EnableEvents = True
End Sub


"Gary''s Student" wrote:

Insert the following worksheet event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a = Range("A:A")
If Intersect(t, a) Is Nothing Then Exit Sub
Application.EnableEvents = False
t.Offset(0, 7).Value = Environ("username")
Application.EnableEvents = True
End Sub

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200796


"chickalina" wrote:

I have a spreadsheet that is shared and there can be up to 12 people using it
at the same time. The Column A is Work Order number and Column H is Submitted
By. I want to have the spreadsheet automatically fill in the Submitted By
cell when a Work Order is entered into Column A. Is this possible?
Thanks for any help!
M

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Enter a User Name When Changes are Made

Works like a charm!!! Thanks so much!

"Gary''s Student" wrote:

There can be only one change event macro on a given sheet. So....we must
combine your logic with mine:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
If IsNumeric(Target) Then
Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy")
Target.Offset(0, 7).Value = Environ("username")
End If
End If
endit:
Application.EnableEvents = True
End Sub

REMEMBER: erase the older versions.

--
Gary''s Student - gsnu200796


"chickalina" wrote:

I'm getting a compile error with another part of my VB code.
M


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then
On Error GoTo endit
Application.EnableEvents = False
If IsNumeric(Target) Then
Target.Offset(0, 8).Value = Format(Date, "mm/dd/yyyy")
End If
End If
endit:
Application.EnableEvents = True
End Sub


"Gary''s Student" wrote:

Insert the following worksheet event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a = Range("A:A")
If Intersect(t, a) Is Nothing Then Exit Sub
Application.EnableEvents = False
t.Offset(0, 7).Value = Environ("username")
Application.EnableEvents = True
End Sub

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200796


"chickalina" wrote:

I have a spreadsheet that is shared and there can be up to 12 people using it
at the same time. The Column A is Work Order number and Column H is Submitted
By. I want to have the spreadsheet automatically fill in the Submitted By
cell when a Work Order is entered into Column A. Is this possible?
Thanks for any help!
M



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
Restricting user to enter the date in a particular format only ! sajjadhyder Excel Discussion (Misc queries) 1 January 3rd 08 05:25 PM
enter user in cell pbs Excel Worksheet Functions 1 July 30th 07 11:26 PM
User must enter something in a range of cells Jugglertwo Excel Discussion (Misc queries) 4 July 27th 06 05:36 AM
how do I enter more data to an already made pull down menu Queenyvix Excel Discussion (Misc queries) 1 February 16th 06 08:10 PM
Avoid user having to enter hours when using [mm]:ss format Lady_luck Excel Discussion (Misc queries) 3 January 4th 05 10:50 AM


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

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

About Us

"It's about Microsoft Excel"