title: Compare two workbooks for differencies cell by cell and colouring differencies in second workbook VBA
body: <p>I tried to compare two workbooks which I put with two different buttons in excel and then using third button compare and colour all of the differences red in the second workbook. I'm pretty new in it, but I need it for my work, I currently finished adding two files with similar codes into two buttons:</p>
  <pre><code>Sub openDialogTemplate()
      Dim ofd As Office.FileDialog
      Dim temwb As Workbook
      Set ofd = Application.FileDialog(msoFileDialogFilePicker)
  
     With ofd
  
        .AllowMultiSelect = False
        .Title = &quot;Please select the Template file.&quot;
        .Filters.Clear
        .Filters.Add &quot;Excel 2003&quot;, &quot;*.xlsx&quot;
        .Filters.Add &quot;All Files&quot;, &quot;*.*&quot;
        If .Show = True Then
          textFileName = .SelectedItems(1)
        End If
        Workbooks.Open Filename:=textFileName
        Set temwb = ActiveWorkbook
     End With
  End Sub
  </code></pre>
  <p>and</p>
  <pre><code>Sub openDialogMaster()
      Dim fd As Office.FileDialog
      Dim maswb As Workbook
          
      Set fd = Application.FileDialog(msoFileDialogFilePicker)
  
     With fd
  
        .AllowMultiSelect = False
        .Title = &quot;Please select the Master file.&quot;
        .Filters.Clear
        .Filters.Add &quot;Excel 2003&quot;, &quot;*.xlsx&quot;
        .Filters.Add &quot;All Files&quot;, &quot;*.*&quot;
        If .Show = True Then
          txtFileName = .SelectedItems(1)
        End If
        Workbooks.Open Filename:=txtFileName
        Set maswb = ActiveWorkbook
     End With
  End Sub
  </code></pre>
  <p>I have no idea how to write a loop correctly using workbooks in temwb and maswb to go cell by cell and color every different cell red in the second workbook.</p>