Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 127
Default "Last Changed By" Cell

Dear Experts,
I have a spreadheet that many people are inputing, and I would like to
capture the name of the last person who updated a certain cell in the nearby
cell (well, inputs in one column, changes tracking in the nearby column).
I would like to do so through some VBA code, could you please help me?

Many, many thanks in advance!
Best regards,
--
Valeria
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default "Last Changed By" Cell

Hi
put the following code in your worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A1:A100")) Is Nothing Then
Exit Sub
End If
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo errhandler
Application.EnableEvents = False
With Target
.Offset(0, 1).Value = Application.UserName
.Offset(0, 2).Value = Format(Date, "DD-MMM-YYYY")
End With

errhandler:
Application.EnableEvents = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"Valeria" schrieb im Newsbeitrag
...
Dear Experts,
I have a spreadheet that many people are inputing, and I would like

to
capture the name of the last person who updated a certain cell in the

nearby
cell (well, inputs in one column, changes tracking in the nearby

column).
I would like to do so through some VBA code, could you please help

me?

Many, many thanks in advance!
Best regards,
--
Valeria


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 127
Default "Last Changed By" Cell

Hi Frank,
I have tried it but I must be doing something wrong, since nothing seems to
happen...
I have put your code in the worksheet module, and then I have tried to
modify some cells in the range from A1 to A100, but as said, nothing has
happened!

Could you please help me again?
Thank you!
Best regards,

Valeria

"Frank Kabel" wrote:

Hi
put the following code in your worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A1:A100")) Is Nothing Then
Exit Sub
End If
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo errhandler
Application.EnableEvents = False
With Target
.Offset(0, 1).Value = Application.UserName
.Offset(0, 2).Value = Format(Date, "DD-MMM-YYYY")
End With

errhandler:
Application.EnableEvents = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"Valeria" schrieb im Newsbeitrag
...
Dear Experts,
I have a spreadheet that many people are inputing, and I would like

to
capture the name of the last person who updated a certain cell in the

nearby
cell (well, inputs in one column, changes tracking in the nearby

column).
I would like to do so through some VBA code, could you please help

me?

Many, many thanks in advance!
Best regards,
--
Valeria



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default "Last Changed By" Cell

Hi
and you have put it in the worksheet module of this specific sheet?. If
you like email me your test file and I'll have a look at it

--
Regards
Frank Kabel
Frankfurt, Germany

"Valeria" schrieb im Newsbeitrag
...
Hi Frank,
I have tried it but I must be doing something wrong, since nothing

seems to
happen...
I have put your code in the worksheet module, and then I have tried

to
modify some cells in the range from A1 to A100, but as said, nothing

has
happened!

Could you please help me again?
Thank you!
Best regards,

Valeria

"Frank Kabel" wrote:

Hi
put the following code in your worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A1:A100")) Is Nothing Then
Exit Sub
End If
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo errhandler
Application.EnableEvents = False
With Target
.Offset(0, 1).Value = Application.UserName
.Offset(0, 2).Value = Format(Date, "DD-MMM-YYYY")
End With

errhandler:
Application.EnableEvents = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"Valeria" schrieb im

Newsbeitrag
...
Dear Experts,
I have a spreadheet that many people are inputing, and I would

like
to
capture the name of the last person who updated a certain cell in

the
nearby
cell (well, inputs in one column, changes tracking in the nearby

column).
I would like to do so through some VBA code, could you please

help
me?

Many, many thanks in advance!
Best regards,
--
Valeria




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default "Last Changed By" Cell

Hi Valeria,
You install by right clicking on the worksheet tab, view code, insert Frank's code.
It is a worksheet event macro, you can read more about them at
http://www.mvps.org/dmcritchie/excel/event.htm

If you ran an Event macro and did not make it the error handler
as in Frank's code or there isn't one, you may have to make sure
you have events enabled. In the VBE first

you can type this into the Intermediate Window (Ctrl+G) of the VBE
first see if you had a problem
Application.EnableEvents
then if it shows False fix it, by typing this into the Intermediate Window
Application.EnableEvents = True
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Frank Kabel" wrote in message ...
Hi
and you have put it in the worksheet module of this specific sheet?. If
you like email me your test file and I'll have a look at it

--
Regards
Frank Kabel
Frankfurt, Germany

"Valeria" schrieb im Newsbeitrag
...
Hi Frank,
I have tried it but I must be doing something wrong, since nothing

seems to
happen...
I have put your code in the worksheet module, and then I have tried

to
modify some cells in the range from A1 to A100, but as said, nothing

has
happened!

Could you please help me again?
Thank you!
Best regards,

Valeria

"Frank Kabel" wrote:

Hi
put the following code in your worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A1:A100")) Is Nothing Then
Exit Sub
End If
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo errhandler
Application.EnableEvents = False
With Target
.Offset(0, 1).Value = Application.UserName
.Offset(0, 2).Value = Format(Date, "DD-MMM-YYYY")
End With

errhandler:
Application.EnableEvents = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"Valeria" schrieb im

Newsbeitrag
...
Dear Experts,
I have a spreadheet that many people are inputing, and I would

like
to
capture the name of the last person who updated a certain cell in

the
nearby
cell (well, inputs in one column, changes tracking in the nearby
column).
I would like to do so through some VBA code, could you please

help
me?

Many, many thanks in advance!
Best regards,
--
Valeria







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default "Last Changed By" Cell

Hi David
Valeria sent me her test file and the reason was that the code was in
the workbook module :-))

--
Regards
Frank Kabel
Frankfurt, Germany

"David McRitchie" schrieb im Newsbeitrag
...
Hi Valeria,
You install by right clicking on the worksheet tab, view code,

insert Frank's code.
It is a worksheet event macro, you can read more about them at
http://www.mvps.org/dmcritchie/excel/event.htm

If you ran an Event macro and did not make it the error handler
as in Frank's code or there isn't one, you may have to make sure
you have events enabled. In the VBE first

you can type this into the Intermediate Window (Ctrl+G) of the VBE
first see if you had a problem
Application.EnableEvents
then if it shows False fix it, by typing this into the Intermediate

Window
Application.EnableEvents = True
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Frank Kabel" wrote in message

...
Hi
and you have put it in the worksheet module of this specific

sheet?. If
you like email me your test file and I'll have a look at it

--
Regards
Frank Kabel
Frankfurt, Germany

"Valeria" schrieb im

Newsbeitrag
...
Hi Frank,
I have tried it but I must be doing something wrong, since

nothing
seems to
happen...
I have put your code in the worksheet module, and then I have

tried
to
modify some cells in the range from A1 to A100, but as said,

nothing
has
happened!

Could you please help me again?
Thank you!
Best regards,

Valeria

"Frank Kabel" wrote:

Hi
put the following code in your worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A1:A100")) Is Nothing Then
Exit Sub
End If
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo errhandler
Application.EnableEvents = False
With Target
.Offset(0, 1).Value = Application.UserName
.Offset(0, 2).Value = Format(Date, "DD-MMM-YYYY")
End With

errhandler:
Application.EnableEvents = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"Valeria" schrieb im

Newsbeitrag
...
Dear Experts,
I have a spreadheet that many people are inputing, and I

would
like
to
capture the name of the last person who updated a certain

cell in
the
nearby
cell (well, inputs in one column, changes tracking in the

nearby
column).
I would like to do so through some VBA code, could you please

help
me?

Many, many thanks in advance!
Best regards,
--
Valeria






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default "Last Changed By" Cell

Hi Frank,
Thanks for the feedback, didn't realize my reply was 8 hours later.
--
David McRitchie, Microsoft MVP - Excel


"Frank Kabel" wrote ...
Hi David
Valeria sent me her test file and the reason was that the code was in
the workbook module :-))



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
Can the Excel cell fill color be changed using "IF" statements? JHG Excel Worksheet Functions 1 May 8th 09 10:13 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


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