Hey All,
So I made this bit of code. Pretty much the purpose is to timestamp as the phases of a project change. (Column G has a set of drop down boxes to choose from). However, I'm facing issues. Such as if you try to delete multiple rows it gives debug errors, and also inserting rows is blanked out. Not sure what all I can do to clean this code up to stop these errors.
Any help would be greatly appreciated!
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngData As Range
Set rngData = ActiveSheet.Range("G1:G4000")
If Not Application.Intersect(rngData, Target) Is Nothing Then
Cells(Target.Row, 8).Value = Now
If Target.Value = "1. Phase 1" Then
Cells(Target.Row, 9).Value = Now
End If
If Target.Value = "2. Phase 2" Then
Cells(Target.Row, 10).Value = Now
End If
If Target.Value = "3. Phase 3" Then
Cells(Target.Row, 11).Value = Now
End If
If Target.Value = "4. Phase 4" Then
Cells(Target.Row, 12).Value = Now
End If
If Target.Value = "5. Phase 5" Then
Cells(Target.Row, 13).Value = Now
End If
If Target.Value = "6. Phase 6" Then
Cells(Target.Row, 14).Value = Now
End If
If Target.Value = "7. Phase 7" Then
Cells(Target.Row, 15).Value = Now
End If
End If
Set rngData = Nothing
Application.EnableEvents = True
If Target.Column = 5 Then
Cells(Target.Row, 6).Value = Now
End If
End Sub
Bookmarks