Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a cell in which a user enters a completion date. I would like to be
able to track 1) the number of times the user changes the date in this cell and 2)by how much he changes the date each time and keep a history of this (ex 20 day slip, 30 day slip etc.) Is there a way to do this in Excel? Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Lee
You could use a Worksheet_Change event macro that would "see" every change made to that cell. That same macro could also "see" what the cell contained before the change and place what you want in some hidden sheet (date, time, amount of slip, etc). Is this something like what you want? Post back if you need help setting this up. Include details about the file/sheet setup and if there is more than one such cell you want to track. HTH Otto "Lee" wrote in message ... I have a cell in which a user enters a completion date. I would like to be able to track 1) the number of times the user changes the date in this cell and 2)by how much he changes the date each time and keep a history of this (ex 20 day slip, 30 day slip etc.) Is there a way to do this in Excel? Thanks in advance. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks, some more details are
I am interested in tracking how many times they slip a date they have originally committed to. It sounds like using Worksheet_Change event might do the job. What I would really like to show from that data is to have two other cells in the same worksheet display 1) the number of times they have changed the date i.e. 1,2,3 etc., and 2) the total slip in days from the original date they entered in the workbook. "Otto Moehrbach" wrote: Lee You could use a Worksheet_Change event macro that would "see" every change made to that cell. That same macro could also "see" what the cell contained before the change and place what you want in some hidden sheet (date, time, amount of slip, etc). Is this something like what you want? Post back if you need help setting this up. Include details about the file/sheet setup and if there is more than one such cell you want to track. HTH Otto "Lee" wrote in message ... I have a cell in which a user enters a completion date. I would like to be able to track 1) the number of times the user changes the date in this cell and 2)by how much he changes the date each time and keep a history of this (ex 20 day slip, 30 day slip etc.) Is there a way to do this in Excel? Thanks in advance. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Lee
This macro does what you want if I am reading you correctly. As written, this macro assumes and does as follows: The date that gets changed is in A1. On the same sheet, C2 and D2 will display the number of times the date has been changed and the total number of days slipped, respectively. There must be a sheet named "Utility". In the Utility sheet, row 1 is for the column headers. In the first empty row of the Utility sheet, this macro will place the date and time of the current change of date in Column A, and the number of days slipped in Column B. Note that this macro must be placed in the sheet module of the sheet that contains the changed date in A1. To access that module, right-click on the sheet tab, select View Code, and paste this macro into the displayed module. "X" out of the module to return to your sheet. If you wish, send me an email and I'll send you the small file I used to develop this code. HTH Otto Private Sub Worksheet_Change(ByVal Target As Range) Dim OldDate As Date Dim NewDate As Date Dim RngColAUtil As Range If Target.Count 1 Then Exit Sub If IsEmpty(Target.Value) Then Exit Sub If Target.Address(0, 0) = "A1" Then Application.ScreenUpdating = False NewDate = Target.Value Application.EnableEvents = False Application.Undo OldDate = Range("A1").Value Range("A1").Value = NewDate With Sheets("Utility") .Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Now Set RngColAUtil = .Range("A2", .Range("A" & Rows.Count).End(xlUp)) RngColAUtil(RngColAUtil.Count).Offset(, 1) = NewDate - OldDate End With [C2].Value = RngColAUtil.Count [D2].Value = Application.Sum(RngColAUtil.Offset(, 1)) Application.EnableEvents = True Application.ScreenUpdating = True End If End Sub "Lee" wrote in message ... Thanks, some more details are I am interested in tracking how many times they slip a date they have originally committed to. It sounds like using Worksheet_Change event might do the job. What I would really like to show from that data is to have two other cells in the same worksheet display 1) the number of times they have changed the date i.e. 1,2,3 etc., and 2) the total slip in days from the original date they entered in the workbook. "Otto Moehrbach" wrote: Lee You could use a Worksheet_Change event macro that would "see" every change made to that cell. That same macro could also "see" what the cell contained before the change and place what you want in some hidden sheet (date, time, amount of slip, etc). Is this something like what you want? Post back if you need help setting this up. Include details about the file/sheet setup and if there is more than one such cell you want to track. HTH Otto "Lee" wrote in message ... I have a cell in which a user enters a completion date. I would like to be able to track 1) the number of times the user changes the date in this cell and 2)by how much he changes the date each time and keep a history of this (ex 20 day slip, 30 day slip etc.) Is there a way to do this in Excel? Thanks in advance. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Otto,
I am pretty new to VBA but I did the view code and associated it with a worksheet and add a blank worksheet called Utility. But when I type in a date to A1 and the macro runs presumable as I am getting no error nothing happens. I do not get anything appearing on the utility worksheet. Do you have any ideas why this may not be working?? Thanks, "Otto Moehrbach" wrote: Lee This macro does what you want if I am reading you correctly. As written, this macro assumes and does as follows: The date that gets changed is in A1. On the same sheet, C2 and D2 will display the number of times the date has been changed and the total number of days slipped, respectively. There must be a sheet named "Utility". In the Utility sheet, row 1 is for the column headers. In the first empty row of the Utility sheet, this macro will place the date and time of the current change of date in Column A, and the number of days slipped in Column B. Note that this macro must be placed in the sheet module of the sheet that contains the changed date in A1. To access that module, right-click on the sheet tab, select View Code, and paste this macro into the displayed module. "X" out of the module to return to your sheet. If you wish, send me an email and I'll send you the small file I used to develop this code. HTH Otto Private Sub Worksheet_Change(ByVal Target As Range) Dim OldDate As Date Dim NewDate As Date Dim RngColAUtil As Range If Target.Count 1 Then Exit Sub If IsEmpty(Target.Value) Then Exit Sub If Target.Address(0, 0) = "A1" Then Application.ScreenUpdating = False NewDate = Target.Value Application.EnableEvents = False Application.Undo OldDate = Range("A1").Value Range("A1").Value = NewDate With Sheets("Utility") .Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Now Set RngColAUtil = .Range("A2", .Range("A" & Rows.Count).End(xlUp)) RngColAUtil(RngColAUtil.Count).Offset(, 1) = NewDate - OldDate End With [C2].Value = RngColAUtil.Count [D2].Value = Application.Sum(RngColAUtil.Offset(, 1)) Application.EnableEvents = True Application.ScreenUpdating = True End If End Sub "Lee" wrote in message ... Thanks, some more details are I am interested in tracking how many times they slip a date they have originally committed to. It sounds like using Worksheet_Change event might do the job. What I would really like to show from that data is to have two other cells in the same worksheet display 1) the number of times they have changed the date i.e. 1,2,3 etc., and 2) the total slip in days from the original date they entered in the workbook. "Otto Moehrbach" wrote: Lee You could use a Worksheet_Change event macro that would "see" every change made to that cell. That same macro could also "see" what the cell contained before the change and place what you want in some hidden sheet (date, time, amount of slip, etc). Is this something like what you want? Post back if you need help setting this up. Include details about the file/sheet setup and if there is more than one such cell you want to track. HTH Otto "Lee" wrote in message ... I have a cell in which a user enters a completion date. I would like to be able to track 1) the number of times the user changes the date in this cell and 2)by how much he changes the date each time and keep a history of this (ex 20 day slip, 30 day slip etc.) Is there a way to do this in Excel? Thanks in advance. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I create a schedule from a list of dates ? | Charts and Charting in Excel | |||
insert date | Excel Worksheet Functions | |||
Date format issue | New Users to Excel | |||
Another Date issue. | Excel Worksheet Functions | |||
NETWORKDAYS - Multiple Date Selection | Excel Discussion (Misc queries) |