title: VBA to find and update row based on value
body: <p>I have a master workbook and multiple children workbooks, each in fixed locations, which hold records of work as individual rows. Rows are copied from the master workbook to the children workbooks based on which of the workbooks are selected.</p>
  
  <p>However, i'm stuck for the VBA coding (in macro form) whereby from within each of the children workbooks, they can update the master. I need it to find and update the work row in the master based on the unique ID number which is assigned to each piece of work and appears in the same column (column D) in both the children and master workbooks.</p>
  
  <p>Any help or ideas would be much appreciated.</p>
  
  <p>Thanks in Advance</p>
  
  <p>Apologies. Please see below data from my sample child workbook (sorry I couldn't format it properly) and below that, the current VBA code I have to copy back to the master workbook:</p>
  
  <p>Data:</p>
  
  <pre><code>Complaint Type  Raised by   Status      ID
  Billing         Percy       Completed   101
  Billing         Percy       Completed   102
  Metering        John        Pending     103
  Reads           John        Pending     104
  Reads           Jack        Pending     105
  Billing         Julie       Untouched   106
  Service         Jack        Completed   107
  Metering        Julie       Untouched   108
  Service         Percy       Pending     109
  Payment         Pete        Pending     110
  </code></pre>
  
  <p>VBA Code:</p>
  
  <pre><code>Private Sub CommandButton21_Click()
  
  With Application
      .ScreenUpdating = False
      .EnableEvents = False
  End With
  
   Dim SourceRange As Range, DestRange As Range
  
   Set SourceRange = Sheets("Sheet1").Range("A2:D2") 'data source
   wb = ActiveWorkbook.Name
  
   Workbooks.Open "C:\Users\user\Desktop\Test.xlsm" 'path to Master
   Windows(wb).Activate 'Activate Child Workbook
   SourceRange.Cut 'define the range to copy 'Cut data from child workbook
  
   Windows("Test.xlsm").Activate 'Activate Master
   Sheets("Completed").Select 'Activate Sheet
   Workbooks("Test.xlsm").Sheets("Completed").Cells(Rows.Count, "A").End(xlUp).Offset(1).Paste 'Paste in Master
  
   Application.CutCopyMode = False 'Clear Clipboard
  
   End Sub
  </code></pre>