Please help: How to make a button to show the sum?

  • Thread starter Thread starter raymondinuk
  • Start date Start date
R

raymondinuk

hi,

In my excel, I would like to make a button which could show the sum o
certain cells, say, E3 to E6, after pressing it. I am wondering if i
is made by VBA? If yes, how?

I would very much appreciate your help if you could help me figure ou
this problem
 
If you select two or more cells that contain numbers, you can see the
sum in the status bar, at the bottom right of the Excel window.

Right-click on the AutoCalculate area of the status bar, and you can
choose from a list of summary functions.
 
Dear Debra,

Thank you for your prompt answer. I have learned another skill fro
your answer but I am afraid I didn't make my problem clear.

What I want to do is to put a button on the worksheet name
"calculate". After pressing this button, I want a dialogue box to po
up and show the sume of certain cells. I think this may need VBA o
macro but I don't know how to figure it out. Need your help again.

Many thanks.
 
You could use a macro like this:

Sub SumCells()
MsgBox WorksheetFunction.Sum(Range("E3:E6"))
End Sub
 
raymond

Alternate with non hard-coded selection.

Sub Sum_Range()
Set rng = Selection
MsgBox WorksheetFunction.Sum(rng)
End Sub

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top