View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Excel Set Up - Auto Sum

This code placed in Thisworkbook module will give you 4 functions on the
status bar.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
'add the functions to the status bar
Application.StatusBar = False
If TypeName(Selection) = "Range" Then
Workbook_SheetSelectionChange Sh, Selection
End If
End Sub


Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)
'display the functions on the status bar
Dim s As String
Dim wfn As WorksheetFunction
Set wfn = Application.WorksheetFunction
On Error GoTo errH:
If wfn.Count(Target) < 2 Then
s = ""
Else
s = "Sum=" & wfn.Sum(Target) & " " & _
"Avg=" & wfn.Average(Target) & " " & _
"Min=" & wfn.Min(Target) & " " & _
"Max=" & wfn.Max(Target) & " " & _
"Count=" & wfn.Count(Target)
End If
errH:
Application.StatusBar = s
End Sub


Gord Dibben MS Excel MVP

On Fri, 10 Apr 2009 14:04:11 -0700, brian
wrote:

At the bottom of the excel worksheet - there is an ability to set up to
display a sum (or average or count or...) of a column. Can Excel be set up
to display more than one option at a time?