Brondum
New member
- Joined
- Nov 2, 2021
- Messages
- 3
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- Excel 2016
Hi all gurus
I am trying to make a way of tracking our process. I have created a dropdown list and when I move to another step in the process it should provide me a timestamp, so that I can see how long time we spend on each step.
I have tried to do something like this:
This should say okay you selected "" in the dropdown list, I will then create a timestamp in the column with the heading identical to selection on dropdown list. Then lastly, lock the cells so that dates cannot be changed again.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim fn As Integer
If Not Intersect(Target, Range("C2:C2500")) Is Nothing Then
fn = [D1:J1].Find(Target.Value).Column
If Cells(Target.Row, fn) = "" Then
Cells(Target.Row, fn).Value = Now
Cells(Target.Row, fn).NumberFormat = "mm/dd/yy"
Cells(Target.Row, fn).Locked = True
End If
End If
End Sub
I am trying to make a way of tracking our process. I have created a dropdown list and when I move to another step in the process it should provide me a timestamp, so that I can see how long time we spend on each step.
I have tried to do something like this:
This should say okay you selected "" in the dropdown list, I will then create a timestamp in the column with the heading identical to selection on dropdown list. Then lastly, lock the cells so that dates cannot be changed again.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim fn As Integer
If Not Intersect(Target, Range("C2:C2500")) Is Nothing Then
fn = [D1:J1].Find(Target.Value).Column
If Cells(Target.Row, fn) = "" Then
Cells(Target.Row, fn).Value = Now
Cells(Target.Row, fn).NumberFormat = "mm/dd/yy"
Cells(Target.Row, fn).Locked = True
End If
End If
End Sub