title: In Excel trying to update rows in Sheet 1 from Sheet 2 based on a unique id found in both sheets
body: <p>My question is similar to some found on this forum, but I can't quite get it to work. I have a master sheet in excel that has all my data with many columns and rows. What happens is, I receive updated data via excel sheets and need to update the master sheet based on a unique id, that is found in both sheets. Not all cells will have new data, so I would like to only update cells that have changed.</p>
  
  <p>What I have found so far works, but it isn't updating all the cells. I'm new to VBA, so any help would be greatly appreciated. If this code is not what I should be doing then I'm willing to scrap it and start from scratch.</p>
  
  <p>Here is the code that I found on this forum, but I can't quite get it to do what I need. I have tried changing it slightly, but to no avail. I have included the code as it appears in the forum. Any help would be greatly appreciated.</p>
  
  <pre><code>Dim sh1 As Worksheet
      Dim rw2 As Range
  
      Set sh1 = Worksheets("Sheet1")
  
      For Each rw2 In Sheets("Sheet2").UsedRange.Rows
        If Not sh1.UsedRange.Columns(1).Find(rw2.Cells(1, 2).Value,, xlValues, xlWhole) Is Nothing Then
          rw2.Cells(1, 5) = sh1.UsedRange.Columns(1).Find(rw2.Cells(1, 2).Value,, xlValues, xlWhole).Offset(0, 6)
        End If
      Next rw2
  </code></pre>