Find differences between two spreadsheets
There are some issues with your code:

1) Try to avoid unqualified references, this means always specify the worksheet, when referencing a cell.

2) Try to avoid formatting a lot of single cells, rather format them all at once at the end. Formatting slows down Excel a lot!

3) When handeling a great deal of Ranges, Integer can be insufficient, use Long instead.

Sub Compare2WorkSheets(ws1 As Worksheet, ws2 As Worksheet)

  Dim ws1row As Long, ws2row As Long, ws1col As Long, ws2col As Long
  Dim maxrow As Long, maxcol As Integer, colval1 As String, colval2 As String
  Dim report As Workbook, difference As Long
  Dim row As Long, col As Long
  Dim unionRng as Range

  Set report = Workbooks.Add

  With ws1.UsedRange
    ws1row = .Rows.Count
    ws1col = .Columns.Count
  End With

  With ws2.UsedRange
    ws2row = .Rows.Count
    ws2col = .Columns.Count
  End With

  maxrow = ws1row
  maxcol = ws1col
  If maxrow &lt; ws2row Then maxrow = ws2row
  If maxcol &lt; ws2col Then maxcol = ws2col

  difference = 0

  With report.Sheets(1)
    For col = 1 To maxcol
      For row = 1 To maxrow
        colval1 = ""
        colval2 = ""
        colval1 = ws1.Cells(row, col).Formula
        colval2 = ws2.Cells(row, col).Formula

        If colval1 &lt;&gt; colval2 Then
          difference = difference + 1
          .Cells(row, col).Value = colval1 &amp; "&lt;&gt; " &amp; colval2 'I guess you want to show, that the formulas used are not equal.
          If unionRng is Nothing Then
            Set unionRng = .Cells(row, col)
          Else
            Set unionRng = Application.Union(unionRng, .Cells(row, col))
          End If
        End If
      Next row
    Next col

    .Columns("A:B").ColumnWidth = 25
  End With

  unionRng.Interior.Color = 255
  unionRng.Font.ColorIndex = 2
  unionRng.Font.Bold = True
  report.SaveAs Filename:="report.xlsx"

  If difference = 0 Then
    report.Close False
  End If
  Set report = Nothing
  MsgBox difference &amp; " cells contain different data! ", vbInformation, _
         "Comparing Two       Worksheets"
End Sub
```