Need help with a macro

mrobertware

New Member
Joined
Mar 25, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am needing help creating a macro that combines part numbers and qty's. For instance, if i have 5 rows of part A, with qty's of 4, I would like the output to show 1 row with a qty of 20. I would like for macro to cover 800 rows (I could have less but no more than 800).

I have sample data.

1711406103305.png
 

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.
Seeing as you have 365, and rather than using VBA, how about:
Book1
ABCDE
1Item NumQtyItem NumQty
27142053417142053411
3714205341713032008
4714205341MH00019
5714205341
6714205344
7714205341
8713032001
9713032001
10713032001
11713032003
12714205341
13714205341
14MH00011
15713032001
16713032001
17MH00014
18MH00011
19MH00011
20MH00011
21MH00011
Sheet1
Cell Formulas
RangeFormula
D2:D4D2=UNIQUE(FILTER(A2:A801,A2:A801<>""))
E2:E4E2=SUMIFS(B2:B801,A2:A801,D2#)
Dynamic array formulas.
 
Upvote 0
Could also us a Pivot Table...no formula required
Book1
ABCDE
1ItemQty
2714205341
3714205341
4714205341Row LabelsSum of Qty
5714205341713032008
67142053447142053411
7714205341MH00019
8713032001Grand Total28
9713032001
10713032001
11713032003
12714205341
13714205341
14MH00011
15713032001
16713032001
17MH00014
18MH00011
19MH00011
20MH00011
21MH00011
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
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