Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That'll do nicely.
Thanks. "Bernie Deitrick" wrote: Adrian, Private Sub Worksheet_SelectionChange(ByVal Target As Range) Range("A1").Value = Application.Sum(Target.SpecialCells(xlCellTypeVisi ble)) End Sub HTH, Bernie MS Excel MVP "Adrian" wrote in message ... Dear Bernie, I got something that behaved similarly (though not as well as this - thank you), but there is an important failing... Set up one column with values such as A,B,C,A,B,C and another column with assorted numerical values. Turn on Auto-filter and display only the rows with A. Select the corresponding numbers by dragging over the visible numbers. The sum in the status bar and the sum from your macro will be different. "Bernie Deitrick" wrote: Adrian, Right click on the sheet tab, select "View Code" and paste the code below into the window that appears. The sum of the selected cells will appear in cell A1. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Range("A1").Value = Application.Sum(Target) End Sub HTH, Bernie MS Excel MVP "Adrian" <Adrian @discussions.microsoft.com wrote in message ... At the bottom of an excel screen, in the status bar, the Sum of selected cells automatically appears. I'd like to have exactly that appear in a cell on the worksheet. I've tried things along the lines of sum(selection) and made it volatile, but everything I've tried misbehaves one way or another. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
reuest formula for auto update status & status date | Excel Worksheet Functions | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
Identifying a selection of a selection of a range | Excel Worksheet Functions | |||
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. | Excel Programming |