Forum Discussion

falloute's avatar
falloute
Copper Contributor
Jul 22, 2020
Solved

When a value changes it then is transfered to another sheet but also retains each change

So if N11 from sheet1 changes then it's posted to A2 in sheet2 but then next input from N11 would go to A3 and so on.
  • JMB17's avatar
    JMB17
    Jul 23, 2020

    falloute 

     

    If N11 is a formula and you believe the calculate event will work better for you, then maybe this is closer to what you want.

     

    Private Sub Worksheet_Calculate()
         Dim source As Range
         Dim lastCell As Range
         
         Set source = Me.Range("N11")
         
         With Worksheets("Sheet2")
              Set lastCell = .Cells(.Rows.Count, 1).End(xlUp)
         End With
         
         If lastCell.Value <> source.Value Or (IsEmpty(lastCell) Xor IsEmpty(source)) Then
              lastCell.Offset(1, 0).Value = source.Value
         End If
         
         Set source = Nothing
         Set lastCell = Nothing
         
    End Sub

Resources