Data Re-arranging for Index file

22strider

Active Member
Joined
Jun 11, 2007
Messages
311
Hello Friends

I need to data in Table 1 into Table2. Data in Table2 will then be used as an index file for some other application process. I tried to explain what needs to be done here. Ideally a code should be able to do this. I know little bit of VBA but there are sections of this tasks that I cannot do.

Table 1 has the current sample data.
For producing result Table2 this needs to be done:
1) A new column ‘IsDelete’ is added
2) In Table 1 if ‘Child Part’ = ‘New Child Part’
a. in Table2 column ‘IsDelete’ will have ‘No’
3) In Table 1 if ‘Child Part’ <> ‘New Child Part’,
a. in Table2 column ‘IsDelete’ will have ‘Yes’
b. The corresponding ‘New Child Part’ from Table 1 will get added to Table2 along with ‘Qty’ and ‘Ref Desig’. And Column ‘IsDelete’ will have ‘No’


Table1
Parent Part Child Part Qty Ref Desig New Child Part
150-0000 500-681AB 1 C3 500-681AB
150-0000 500-103AB 1 C4 500-103AB
150-0000 500-222AB 1 C2 500-222
150-0000 500-154AB 1 R3 500-154
150-0000 500-155 1 R2 500-155LF

Table2
Parent Part Child Part Qty Ref Desig IsDelete
150-0000 500-681AB 1 C3 No
150-0000 500-103AB 1 C4 No
150-0000 500-222AB 1 C2 Yes
150-0000 500-154AB 1 R3 Yes
150-0000 500-155 1 R2 Yes
150-0000 500-222 1 C2 No
150-0000 500-154 1 R3 No
150-0000 500-155LF 1 R2 No

Thanks for your help
Rajesh
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Table1
Parent Part Child Part Qty Ref Desig New Child Part
150-0000 500-681AB 1 C3 500-681AB
150-0000 500-103AB 1 C4 500-103AB
150-0000 500-222AB 1 C2 500-222
150-0000 500-154AB 1 R3 500-154
150-0000 500-155 1 R2 500-155LF


Table2
Parent Part Child Part Qty Ref Desig IsDelete
150-0000 500-681AB 1 C3 No
150-0000 500-103AB 1 C4 No
150-0000 500-222AB 1 C2 Yes
150-0000 500-154AB 1 R3 Yes
150-0000 500-155 1 R2 Yes
150-0000 500-222 1 C2 No
150-0000 500-154 1 R3 No
150-0000 500-155LF 1 R2 No
 
Upvote 0
Hello Friends

I am posting tables again:


Excel 2007
BCDEF
2Table1
3Parent PartChild PartQtyRef DesigNew Child Part
4150-0000500-681AB1C3500-681AB
5150-0000500-103AB1C4500-103AB
6150-0000500-222AB1C2500-222
7150-0000500-154AB1R3500-154
8150-0000500-1551R2500-155LF
9
10Table2
11Parent PartChild PartQtyRef DesigIsDelete
12150-0000500-681AB1C3No
13150-0000500-103AB1C4No
14150-0000500-222AB1C2Yes
15150-0000500-154AB1R3Yes
16150-0000500-1551R2Yes
17150-0000500-2221C2No
18150-0000500-1541R3No
19150-0000500-155LF1R2No
Sheet1
 
Upvote 0

Forum statistics

Threads
1,216,297
Messages
6,129,954
Members
449,544
Latest member
Akhil333

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