Hello Friends
Could anyone please help figuring out macro (VBA routine) for the following?
The original spreadsheet has bill of materials (BOM) export with columns ParentItem, ChildItem, Qty and RefDesig. Following is the sample table:
ParentItem Child Item Qty RefDesig
P12345 C12345 2 R12,R23
P12345 C45678 3 C56,C45,C89
P12345 C6598 4
Entries under column RefDesig are separated by comma.
I need a macro that would read and count entries under RefDesig and enter rows one each for RefDesig and change qty from its original number to 1. And if there is no RefDesig the Qty will remain as is.
Following is the table showing expected output:
ParentItem Child Item Qty RefDesig
P12345 C12345 1 R12
P12345 C12345 1 R23
P12345 C45678 1 C56
P12345 C45678 1 C45
P12345 C45678 1 C89
P12345 C6598 4
You may notice that the row one (in the original table) has been split into two rows (because in original table it had 2 reference designators) and the row two has been split into three rows. And row three in the original table remains as is in the result table because there was no reference designator.
Thanks
Rajesh
Could anyone please help figuring out macro (VBA routine) for the following?
The original spreadsheet has bill of materials (BOM) export with columns ParentItem, ChildItem, Qty and RefDesig. Following is the sample table:
ParentItem Child Item Qty RefDesig
P12345 C12345 2 R12,R23
P12345 C45678 3 C56,C45,C89
P12345 C6598 4
Entries under column RefDesig are separated by comma.
I need a macro that would read and count entries under RefDesig and enter rows one each for RefDesig and change qty from its original number to 1. And if there is no RefDesig the Qty will remain as is.
Following is the table showing expected output:
ParentItem Child Item Qty RefDesig
P12345 C12345 1 R12
P12345 C12345 1 R23
P12345 C45678 1 C56
P12345 C45678 1 C45
P12345 C45678 1 C89
P12345 C6598 4
You may notice that the row one (in the original table) has been split into two rows (because in original table it had 2 reference designators) and the row two has been split into three rows. And row three in the original table remains as is in the result table because there was no reference designator.
Thanks
Rajesh