+ Reply to Thread
Results 1 to 4 of 4

Status Bar : Display both Sum and Count

  1. #1
    Keerthy
    Guest

    Status Bar : Display both Sum and Count

    Hello Experts!

    I would like to show both Sum and Count of the selected cells on the
    status bar. How can I do that?

    -Keerthy


  2. #2
    Norman Jones
    Guest

    Re: Status Bar : Display both Sum and Count

    Hi Keerthy,

    The following represents an adaptation of code posted by Ron de Bruin and
    perhaps it nay be of use to you:

    '=============================>>
    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
    ByVal Target As Range)
    On Error GoTo ErrHandler:
    With Application
    .StatusBar = "Sum: " & Application.Sum(Target) & " | " _
    & "Count(Nums): " & .WorksheetFunction.Count(Target) _
    & " | Count(items): " & Application.CountA(Target) _
    & " | Average: " & Application.Average(Target)
    End With
    Exit Sub
    ErrHandler:
    Application.StatusBar = False
    End Sub
    '<<=============================

    This is workbook event code and should be pasted into the workbook's
    ThisWorkbook module *not a standard module or a sheet module):

    ************************************************************
    Right-click the Excel icon on the worksheet
    (or the icon to the left of the File menu if your workbook is maximised)

    Select 'View Code' from the menu and paste the code.

    Alt-F11 to return to Excel.
    ************************************************************

    ---
    Regards,
    Norman



    "Keerthy" <[email protected]> wrote in message
    news:[email protected]...
    > Hello Experts!
    >
    > I would like to show both Sum and Count of the selected cells on the
    > status bar. How can I do that?
    >
    > -Keerthy
    >




  3. #3
    S K
    Guest

    Re: Status Bar : Display both Sum and Count

    Hello Norman Jones,

    Thanks! that helps. I was wondering if I have to cut and paste this in
    every workbook!? Can't this be available on the excel immeterial of
    which work book (file) I'm working on?

    -Keerthy


    *** Sent via Developersdex http://www.developersdex.com ***

  4. #4
    Norman Jones
    Guest

    Re: Status Bar : Display both Sum and Count

    Hi Keerthy,

    Open a new workbook and paste the code into the ThisWorkbook module. Then,
    save the workbook, with a suitable name, selecting 'Template' in 'Save as
    Type' dropdown.

    Thereafter, any workbook opened from the template, will have the same
    functionality.

    If you truly want this code in *all* new workbooks, then open the default
    workbook template (Book.xlt) in the XLSTART folder, paste the code and save.

    ---
    Regards,
    Norman



    "S K" <[email protected]> wrote in message
    news:%[email protected]...
    > Hello Norman Jones,
    >
    > Thanks! that helps. I was wondering if I have to cut and paste this in
    > every workbook!? Can't this be available on the excel immeterial of
    > which work book (file) I'm working on?
    >
    > -Keerthy
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1