AUTOSUM Macro

Johnny Thunder

Well-known Member
Joined
Apr 9, 2010
Messages
693
Office Version
  1. 2016
Platform
  1. MacOS
Hello Friends,



I come with a question regarding a macro I am trying to create.

I have a spreadsheet that is column A:S.

Column A = Account Number
Column R = Credit
Column S = Debit

Each time the spreadsheet encounters a new account there is a blank row that divides the accounts. I am trying to write a macro that will look too column R & S and sum the amounts above it and when it encounters a blank line begin a new sum.


What I am trying to accomplish is to have all the blank rows showing the sum for each debit/credit for one specific account. I am going to use this for an upload file.

Any help will be appreciated.

Excel 2003
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
There is the Subtotal feature under the Data menu that is basically designed to do just this.

It doesn't really need the blank rows in between the accounts . It will insert the subtotals each time there is a change in the accounts in column A.

  • Select all your data in A:S
  • Select from the menu Data\ Subtotals
    • At each change in: Column A
    • Use function: Sum
    • Add subtotal to: Columns R and S
    • OK

If you want to delete the blank rows.
  • Select column A
  • Select from the menu Data\ Filter\ Autofilter
  • Select from the drop-down list in A1: Blanks
  • Select all the fitered blank rows and delete them
  • Select Autofilter from the menu again to turn it off.
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,553
Members
452,928
Latest member
101blockchains

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