A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Thanks Pavan.
But, I would like to select any two cells and need not be in A1 or B1 .
Hi,
Right click the sheet tab, view code and paste this in and close VB editor.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Cells.Count = 2 Then
On Error Resume Next
If WorksheetFunction.Count(Range(Selection.Address)) = 2 Then
Application.StatusBar = "The difference is " & _
WorksheetFunction.Max(Range(Selection.Address)) _
- WorksheetFunction.Min(Range(Selection.Address))
Else
Application.StatusBar = "The difference is " & _
WorksheetFunction.Max(Range(Selection.Address))
End If
Else
Application.StatusBar = False
End If
End Sub