title: Display the difference between two cells in excel status bar
body: <p>I was looking for code to determine the difference between two selected cells and display it in the status bar of Excel 2010.</p>
  
  <p>I found some code, but it applies only to the workbook that contains that code.
  Is it possible to make this code functional on every workbook I am working with?
  It would be great if this kind of code runs automatically like macros from personal.xlsb.</p>
  
  <pre><code>Public Sub workbook_SheetSelectionChange(ByVal sh As Object, ByVal Target As Range)
  Set sh = ActiveSheet
  If Selection.Cells.Count = 2 Then
     On Error Resume Next
      If WorksheetFunction.Count(Range(Selection.Address)) = 2 Then
          Application.StatusBar = "The difference is " &amp; _
          WorksheetFunction.Max(Range(Selection.Address)) _
          - WorksheetFunction.Min(Range(Selection.Address))
      Else
          Application.StatusBar = "The difference is " &amp; _
          WorksheetFunction.Max(Range(Selection.Address))
      End If
  Else
      Application.StatusBar = False
  End If
  End Sub
  </code></pre>