title: Applying timestamp to dynamic row upon change event
body: <p><strong>Goal:</strong></p>
  
  <p>I would like to have a date/time stamp put into one column beyond the last column in the row being changed, based on a change event.  The cell's value when selected is to be compared to that same cell's value when it is no longer the target.</p>
  
  <p><strong>Current Code:</strong></p>
  
  <p><em>Within the Sheet1 View Code</em></p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
  
  'MsgBox "Now: " &amp; Now()
  
  Dim i, j As Integer
  Dim k As String
  Dim LC As Long
  
  i = Target.Row
  j = Target.Column
  k = Target.Value
  LC = Cells(i, Columns.Count).End(xlToLeft).Column
  
  If Not Cells(i, j).Value = k Then
      Cells(i, LC + 1).Formula = Format(Now(), "yyyyMMddhhmmss")
  End If
  
  End Sub
  </code></pre>
  
  <p><strong>Problem:</strong></p>
  
  <p>After trying to run this code, I cannot get any output.  I tested using MsgBox "Now: "&amp;now(), which does show me that the change event code is in the correct place (I commented that out, but it was how I checked what <em>should</em> have appeared.</p>
  
  <p>I thought that, by defining i, j, and k, outside of the If statement that I could save those values and compare values from selection compared to when not selected.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>Is the way I am setting this code up inappropriate, and if so how would I correct this to be more appropriate?  This is my first time playing with change events.</p>
  
  <p>Edit1:  Adding more specifics to goal, considering comment by @ScottCraner</p>