Part One:-
Private Sub Worksheet_Change(ByVal Target As Range)
A = Split(Replace(Target.Address, ":", ""), "$")
If A(1) = "A" And A(3) = "A" Then Range(Cells(A(2), 5), Cells(A(4), 5)).Value = Date
End Sub
Part 2:-
Private Sub Worksheet_Change(ByVal Target As Range)
If InStr(Target.Address, ":") = 0 Then
A = Target.Address & ":" & Target.Address
Else
A = Target.Address
End If
B = Split(A, ":")
B1 = Range(B(0)).Column
B2 = Range(B(1)).Column
If B1 > 1 And B1 < 5 And B2 > 1 And B2 < 5 Then Range(Cells(Range(B(0)).Row, 6), Cells(Range(B(1)).Row, 6)).Value = Date
End Sub
Part3:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If InStr(Target.Address, ":") = 0 Then
A = Target.Address & ":" & Target.Address
Else
A = Target.Address
End If
B = Split(Replace(A, ":", ""), "$")
For Count = B(2) * 1 To B(4) * 1
If Cells(Count, 7) = "" Then Cells(Count, 7) = Date
Next
Application.EnableEvents = True
End Sub
So putting those together and tidying up:-
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If InStr(Target.Address, ":") = 0 Then
A = Target.Address & ":" & Target.Address
Else
A = Target.Address
End If
If A(1) = "A" And A(3) = "A" Then Range(Cells(A(2), 5), Cells(A(4), 5)).Value = Date
B = Split(A, ":")
B1 = Range(B(0)).Column
B2 = Range(B(1)).Column
If B1 > 1 And B1 < 5 And B2 > 1 And B2 < 5 Then Range(Cells(Range(B(0)).Row, 6), Cells(Range(B(1)).Row, 6)).Value = Date
C = Split(Replace(A, ":", ""), "$")
For Count = C(2) * 1 To C(4) * 1
If Cells(Count, 7) = "" Then Cells(Count, 7) = Date
Next
Application.EnableEvents = True
End Sub
Bookmarks