Quote Originally Posted by anandbohra
Sheet right click menu will do

say I right click on any sheet & click show details (to show your code output in statusbar)
& when not required hide details (to make statusbar = false)
Add this to ThisWorkbook

[vba]

Option Explicit

Private WithEvents App As Application

Private Sub App_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)

If SBCtl.State = msoButtonDown Then

ShowSBInfo
Else

Application.StatusBar = False
End If

End Sub

Private Sub Workbook_Open()
Set App = Application

With Application.CommandBars("Cell")

On Error Resume Next
.Controls("Statusbar info").Delete
On Error GoTo 0

Set SBCtl = .Controls.Add(Type:=msoControlButton, temporary:=True)

With SBCtl

.BeginGroup = True
.Caption = "Statusbar info"
.State = msoButtonUp
.OnAction = "ToggleStatusbar"
End With

Call sbinfo
End With
End Sub
[/vba]

and this to a standard code module

[vba]


Global SBCtl As CommandBarControl

Public Function ToggleStatusbar()
If SBCtl.State = msoButtonDown Then

SBCtl.State = msoButtonUp
Application.StatusBar = False
Else

SBCtl.State = msoButtonDown
ShowSBInfo
End If
End Function

Public Function ShowSBInfo()
Dim statusLine As String

On Error Resume Next
With Application.WorksheetFunction
statusLine = "Sum=" & .Sum(Selection)
statusLine = statusLine & "; Average=" & .Average(Selection)
statusLine = statusLine & "; Non-blank=" & .CountA(Selection)
statusLine = statusLine & "; Min=" & .Min(Selection)
statusLine = statusLine & "; Max=" & .Max(Selection)
End With

Application.StatusBar = statusLine
End Function
[/vba]