Entering a Summation Value in a Cell

azizrasul

Well-known Member
Joined
Jul 7, 2003
Messages
1,304
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
I wish to place a summation value in a single cell in a spreadsheet (using VBA). Each spreadsheet will have a different number of rows and columns.

However the most right hand column (Total Savings) has a column of numbers which I want to summate and placed at the bottom of this column, like so.


Total Savings
23
43
..
54

324

I have the values of the numbers of rows and columns calculated within MS Access and the summated value.
Code:
   intRow = DCount("*", "qryAllTrustsSummarisedReport")
            intCol = rstFields.Fields.Count
            intSum = DSum("[Total Savings]", "qryAllTrustsSummarisedReport")

What code can I use to place intSum in the correct position? Thanks in advance.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,221,849
Messages
6,162,425
Members
451,765
Latest member
craigvan888

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