Good Afternoon,
I have a code to change cell in Column B when A is changed. I would like to also compare this new value in column B to the cell above it, and if different put todays date in column G.
Any Ideas? Here is my code: Have it on Worksheet - Change
I have a code to change cell in Column B when A is changed. I would like to also compare this new value in column B to the cell above it, and if different put todays date in column G.
Any Ideas? Here is my code: Have it on Worksheet - Change
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim aCellColumn As Integer
Dim aTimeColumn As Integer
Dim aRow, aCol As Integer
Dim aDPRg, aRg As Range
aCellColumn = 1
aTimeColumn = 2
aRow = Target.Row
aCol = Target.Column
If Target.Text <> "" Then
If aCol = aCellColumn Then
Cells(aRow, aTimeColumn) = Sheets("Main").Range("D2").Value
Else
On Error Resume Next
Set aDPRg = Target.Dependents
For Each aRg In aDPRg
If aRg.Column = aCellColumn Then
Cells(aRg.Row, aTimeColumn) = Sheets("Main").Range("D2").Value
End If
Next
End If
End If
End Sub