Sum Macro

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
I have a file that has my monthly revenue listed by account and parent #. I want to have a macro that will give me a new sheet listing the total by parent#.

An example, accounts 1, 5, 7 belong to parent 14. So I want to summarize those accounts and put the one line total on the new sheet. I hope that is clear.

Thanks . . .
texasalynn
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Bass Blayde

New Member
Joined
Oct 23, 2002
Messages
2
Have you tried the "subtotal" command? You will need to sort your data by Parent, then choose Data, Subtotals, and follow the prompts. Once you've done that, copy the results to a new worksheet. To copy only the subtotals, first click on the appropriate outline box in the upper left corner so only your subtotals are showing. Highlight the area to copy, then choose Edit, Goto, click Special, then click Visible Cells Only, then paste the result where you want it.

Hope this helps.

Bass
 

plettieri

Well-known Member
Joined
Sep 4, 2002
Messages
1,556
Platform
  1. MacOS
hi

There might be some other options, care to post a short sample and the expected outcome so we can see better...You can use the utility noted under this text box Download Colo's cool utility for displaying your Excel Worksheet on the board.

pll
 

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
ok - here is just a same sample of the data
Book3
ABCDE
1ParentSTOREACCTLOCATIONTOTAL
282325006-0347-0121327HOOBSGAS45.00
382325006-0347-0284919HOOBSGAS40.00
482314006-1788-0151811HOOBSGAS80.00
582310006-1788-0151837HOOBSGAS107.00
682322006-1788-0151845HOOBSGAS60.00
782325006-1788-0151852HOOBSGAS45.00
8824188006-1788-0160416RELIZE-DMGS212.68
9825170006-1788-0152272RELIZE-RMSGS336.00
10826170006-1788-0152264RELIZE-MCGS59.75
11826160006-1788-0160432RELIZE-MCGS1,894.52
12827188006-1788-0152256RELIZE-BGS89.63
13827160006-1788-0160382RELIZE-BGS796.00
Sheet1


I want the new sheet to show the parent number and the summarized amounts.

HTH
texasalynn
 

plettieri

Well-known Member
Joined
Sep 4, 2002
Messages
1,556
Platform
  1. MacOS
You could use the sumif function as one choice
index-ptr-titles.xls
FGHIJ
11STOREACCTLOCATIONTOTAL
1282325006-0347-0121327HOOBSGAS45.00
1382325006-0347-0284919HOOBSGAS40.00
1482314006-1788-0151811HOOBSGAS8.00
1582310006-1788-0151837HOOBSGAS107.00
1682322006-1788-0151845HOOBSGAS80.00
1782325006-1788-0151852HOOBSGAS45.00
18824188006-1788-0160416RELIZE-DMGS212.68
19825170006-1788-0152272RELIZE-RMSGS336.00
20826170006-1788-0152264RELIZE-MCGS59.75
21826160006-1788-0160432RELIZE-MCGS
22827188006-1788-0152256RELIZE-BGS8,963.00
23827160006-1788-0160382RELIZE-BGS796.00
24
25
26
27
28
29823325.00
30824212.68
31825336.00
Sheet5



modifying to fit your needs..

hope this helps

pll
 

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
No - I really have to have a macro to put the summarized data on a new sheet. That was only a small sample. My sheet might have 20,000+ lines. The summary is what is distributed and we don't want the detail listed.

Bass - I like your answer. I have never explored much of the Goto - Special options. That might be what I could use to create a macro.

Thanks . . .
texasalynn
 

Forum statistics

Threads
1,144,274
Messages
5,723,447
Members
422,497
Latest member
dougy99

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
Top