VBA for adding cells then posting them into a unique cell

Mrnewb

New Member
Joined
Oct 7, 2013
Messages
13
Hi, and thanks in advance for any help.

I need a code that will look an ID in columb A then add all the same ID's assosated values in columb C, it must then transfere this data to a second sheet and lookup the assosiated date and ID a past into the correct cell. "sounds easy"
Sheet1
Document Number2nd Item NumberTrans QTYOrder DatePlan Fmly
115466301/6029H30003/12/2018248
115466401/6059H4003/12/2018248
115466401/6059H10003/12/2018248
115466401/6059H10003/12/2018248
115021901/6224H6403/12/2018248
115021901/6224H6403/12/2018248
115021901/6224H6403/12/2018248
115021901/6224H6403/12/2018248
<colgroup><col width="112" style="width: 84pt; mso-width-source: userset; mso-width-alt: 4096;"> <col width="98" style="width: 74pt; mso-width-source: userset; mso-width-alt: 3584;"> <col width="64" style="width: 48pt;"> <col width="81" style="width: 61pt; mso-width-source: userset; mso-width-alt: 2962;"> <col width="67" style="width: 50pt; mso-width-source: userset; mso-width-alt: 2450;"> <tbody> </tbody>

Sheet 2

Works order
Component NumberMonday
TuesdayWednesday
03/12/201804/12/201805/12/2018
PDNPDNPDN
1165904174/600000
115520013/5292000
115513513/5057000
115655213/7113000
115520513/5319000
<colgroup><col width="112" style="width: 84pt; mso-width-source: userset; mso-width-alt: 4096;"> <col width="80" style="width: 60pt; mso-width-source: userset; mso-width-alt: 2925;"> <col width="82" style="width: 62pt; mso-width-source: userset; mso-width-alt: 2998;" span="3"> <tbody> </tbody>



IE it will take ID (1154664 ) in sheet 1 Add the "Trans Qty" together for that ID only, the take that value and past it under Mondays 03/12/2018 (Must use the assosiated date to chos the columb) columb in sheet 2 in the row marked (1154664).

Is this possible? I tried but nt evenknow where to start on this one?

Thanks again .
 
Last edited:

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
It's a little hard to see exactly what you want, since your example doesn't have expected results, and I can't figure out where the dates are, but you should be able to use SUMIFS. In your example above on the second sheet in C4, try this:

=SUMIFS(Sheet1!$C:$C,Sheet1!$A:$A,$A4,Sheet1!$D:$D,C$2)

The A4 is the ID which will match on the A column on Sheet1, and the C$2 is the date that should match the D column on Sheet1. You should be able to drag the formula down and across as needed.
 
Last edited:
Upvote 0
Thank you Eric W, I have changed things to make your formula work, Is there a way to do the same thing with VBA so that I can delete the original data but keep the "Calculated" data?
 
Upvote 0
Sure, you can do that. I'd need to know what your worksheet looks like now, since you say you changed things. You may want to try to just copy the Calculated data, and do a Paste Special/Values to keep it.
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,301
Members
449,078
Latest member
nonnakkong

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