How Do I Copy a Table Data to a Report, Sum some Columns, Omitting others?

TedJL

New Member
Joined
Feb 26, 2014
Messages
2
I recall seeing this operation done very simply but don't recall the function or macro. Suppose I have the table A1..G5 as a list of materials and manhours to produce them. After selecting quantities, I want to extract only those rows that are not zero and omit certain other columns, i.e. columns D and E in the example, and paste them somewhere in summary form, such as in columns H through L in the example. I also want the subtotal columns summed for the grand total at the bottom. I think this was done using a copy and paste function or macro or combo of both. It was in an MS DOS version of Excel, and the pasting range had the desired column headers predefined before the macro was initiated. I believe the first line under each Subtotal column (K3 and L3 in the example) had a pre-filled zero, but don't know if it was from a formula or what. That's all I remember. Any ideas?

[TABLE="width: 1000"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD][/TD]
[TD]-->
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K
[/TD]
[TD]L
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[TD]Main Tbl
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]-->
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Qty
[/TD]
[TD]Descr.
[/TD]
[TD]Units
[/TD]
[TD]MH/Unit
[/TD]
[TD]$/Unit
[/TD]
[TD]Subtotal MH
[/TD]
[TD]Subtotal $ Mat'l
[/TD]
[TD]-->
[/TD]
[TD]QTY
[/TD]
[TD]Descr.
[/TD]
[TD]Units
[/TD]
[TD]Subtot. MH
[/TD]
[TD]Subtot. $ Mat'l
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]1
[/TD]
[TD]WidgetA
[/TD]
[TD]Ea
[/TD]
[TD].25
[/TD]
[TD]0.33
[/TD]
[TD]=A3*D3
[/TD]
[TD]=A3*E3
[/TD]
[TD]-->
[/TD]
[TD]1
[/TD]
[TD]WidgetA
[/TD]
[TD]Ea
[/TD]
[TD].25
[/TD]
[TD].33
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD]WidgetB
[/TD]
[TD]Ea
[/TD]
[TD].25
[/TD]
[TD]0.33
[/TD]
[TD]=A4*D4
[/TD]
[TD]=A4*E4
[/TD]
[TD]-->
[/TD]
[TD]2
[/TD]
[TD]WidgetB
[/TD]
[TD]Ea
[/TD]
[TD].35
[/TD]
[TD].41
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]2
[/TD]
[TD]WidgetC
[/TD]
[TD]Ea
[/TD]
[TD].35
[/TD]
[TD].41
[/TD]
[TD]=A5*D5
[/TD]
[TD]=A5*E5
[/TD]
[TD]-->
[/TD]
[TD][/TD]
[TD]Grand Tot.
[/TD]
[TD][/TD]
[TD]=@Sum(K3..K4)
[/TD]
[TD]=@Sum (L3..L4)
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Sorry I omitted the designator for column G. And cell I4 should read "WidgetC" not "WidgetB".
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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