I am using code to show in a column when another column was last modified.
here's the code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Row < 2 Then Exit Sub
If Target.Column < 5 Then Exit Sub
If Target.Column > 5 Then Exit Sub
Cells(Target.Row, 6) = Now
End Sub
what i want to do is repeat this lot for another column as well, with a different target column like
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Row < 2 Then Exit Sub
If Target.Column < 5 Then Exit Sub
If Target.Column > 54 Then Exit Sub
Cells(Target.Row, 3) = Now
End Sub
and
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Row < 2 Then Exit Sub
If Target.Column < 7 Then Exit Sub
If Target.Column > 7 Then Exit Sub
Cells(Target.Row, 8) = Now
End Sub
Is there a way of doing both of these on one sheet or joining the two sets of code? so far I can only get one or the other column to work.
here's the code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Row < 2 Then Exit Sub
If Target.Column < 5 Then Exit Sub
If Target.Column > 5 Then Exit Sub
Cells(Target.Row, 6) = Now
End Sub
what i want to do is repeat this lot for another column as well, with a different target column like
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Row < 2 Then Exit Sub
If Target.Column < 5 Then Exit Sub
If Target.Column > 54 Then Exit Sub
Cells(Target.Row, 3) = Now
End Sub
and
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Row < 2 Then Exit Sub
If Target.Column < 7 Then Exit Sub
If Target.Column > 7 Then Exit Sub
Cells(Target.Row, 8) = Now
End Sub
Is there a way of doing both of these on one sheet or joining the two sets of code? so far I can only get one or the other column to work.