Cell value = cell. selected ??? pls help

marcusbox

New Member
Joined
Jul 9, 2014
Messages
10
Hello all,



When I select a range of cells, my desire outcome is to get a total value quickly. As I can see result from status bar on the lower right hand corner.
Let's say the cell "A1" is the target cell. How can I set the value of Cell "A1" according to the total value of the range of cell that I selected? Any help is very much appreciated. thanks :)
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi WarPiglet,

I want to display the total value of my selected range in cell "A1" how can I do it? thanks
 
Upvote 0
If you are planning in advance just use the sum function.
A1: =sum(selection)

If you want this to occur on the fly you'll probably need a macro. A simple code to do it is, in a standard code module:

Code:
Sub SumSelection()
Range("a1").Value = WorksheetFunction.Sum(Selection)
End Sub

Set the macro to fire on a shortcut keystroke e.g. CTRL+S
 
Upvote 0
I like what teeroy did, but you can also use a msgbox
MsgBox application.worksheetfunction.sum(selection)
 
Upvote 0
If you are planning in advance just use the sum function.
A1: =sum(selection)

If you want this to occur on the fly you'll probably need a macro. A simple code to do it is, in a standard code module:

Code:
Sub SumSelection()
Range("a1").Value = WorksheetFunction.Sum(Selection)
End Sub

Set the macro to fire on a shortcut keystroke e.g. CTRL+S


Nice! It's simple and very straight forward, thanks!
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top