Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For my example, I'm using cell <code>G4</code> as the one that will be updated by your coworker. You have to have some way to persist the original value of <code>G4</code> in order to tell when it's been changed. The easy way to do this is to pick some cell that is out of sight of the user and store the number there so you can reference it later. Here I've chosen cell <code>AA1</code>. The following code must be added specifically to <code>Sheet2</code> since it needs to monitor the changed events on that sheet only so it can fire when <code>G4</code> is updated. </p> <pre><code>Private Sub Worksheet_Change(ByVal Target As Range) If Range("G4") &lt;&gt; Range("AA1") Then Dim lastRow As Long Range("AA1") = Range("G4") lastRow = Worksheets("Sheet1").UsedRange.Rows.Count Worksheets("Sheet1").Cells(lastRow + 1, 1).Value = Date Worksheets("Sheet1").Cells(lastRow + 1, 2).Value = Range("AA1") End If End Sub </code></pre> <p>Keep in mind that this is a very "quick and dirty" approach for this task, as there are no error handlers or much flexibility in the way it works. </p> <hr> <p><strong>EDIT --</strong></p> <p>One other method you could use is referenced here, and can simply check to see if a given cell has changed, without verifying the difference in value. </p> <pre><code> Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Range("G4"), Range(Target.Address)) Is Nothing Then Dim lastRow As Long Range("AA1") = Range("G4") lastRow = Worksheets("Sheet1").UsedRange.Rows.Count Worksheets("Sheet1").Cells(lastRow + 1, 1).Value = Date Worksheets("Sheet1").Cells(lastRow + 1, 2).Value = Range("AA1") End If End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload