Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
is there any formula that let's you sum all the numbers before the number you
select? for example, Col 1 Col 2 1 5 2 2 3 9 ..... so if the number 9 is chosen then it adds 9+2+5 or if 2 is chosen then it adds 2+5. Keeping in mind that there are X numbers so the list could have 1600 numbers. thanks. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Target On Error Resume Next MsgBox Application.Sum(Range(Cells(1, .Column), Target)) On Error GoTo 0 End With End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click -- --- HTH Bob (change the xxxx to gmail if mailing direct) "A.S." wrote in message ... is there any formula that let's you sum all the numbers before the number you select? for example, Col 1 Col 2 1 5 2 2 3 9 .... so if the number 9 is chosen then it adds 9+2+5 or if 2 is chosen then it adds 2+5. Keeping in mind that there are X numbers so the list could have 1600 numbers. thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
My discovery on adding months and days to a date! | Excel Worksheet Functions | |||
adding days | Excel Discussion (Misc queries) | |||
Please help with adding automatic data. | Excel Discussion (Misc queries) | |||
Rounding Error when adding or subtracting two cells | Excel Worksheet Functions | |||
adding vertical bars to an embedded chart using VBA | Excel Discussion (Misc queries) |