D
D Zandveld
Hi, I have an array of data as per below in 'OldWorksheet':
Supply Category Supplier
Product 1 Supplier 1;Supplier 3
Product 2 Supplier 2
Product 3 Supplier 1;Supplier 3;Supplier 6
Product 2 Supplier 5
Product 2 Supplier 4;Supplier 5
Product 2 Supplier 1;Supplier 2;Supplier 3
Product 4 Supplier 2
Product 4 Supplier 2;Supplier 1
Product 4 Supplier 5;Supplier 1
Product 5 Supplier 3
Product 5 Supplier 4;Supplier 5
Product 6 Supplier 4
Product 1 Supplier 3
What I need to do is create a list of Unique Suppliers (Column A,
'Newworksheet'), with the products they supply (In Column B, 'Newworksheet')
- if multiple products, they can either be all in the same cell and
separated, or in subsequent columns (C, D, E etc.)
Logically I imagine it involves:
1. Using text-to-columns to initially split the supplier names out into
seperate cells
2. Identifying the unique records in the array
3. Copying this list to 'NewWorksheet'!Column A
4. Sequentially looking up each product by supplier from 'OldWorksheet' and
placing them in 'NewWorksheet'!Column B, C, D etc.
Any hints, I imagine it needs some logic applied as well as Excel & VBA.
Thanks
Supply Category Supplier
Product 1 Supplier 1;Supplier 3
Product 2 Supplier 2
Product 3 Supplier 1;Supplier 3;Supplier 6
Product 2 Supplier 5
Product 2 Supplier 4;Supplier 5
Product 2 Supplier 1;Supplier 2;Supplier 3
Product 4 Supplier 2
Product 4 Supplier 2;Supplier 1
Product 4 Supplier 5;Supplier 1
Product 5 Supplier 3
Product 5 Supplier 4;Supplier 5
Product 6 Supplier 4
Product 1 Supplier 3
What I need to do is create a list of Unique Suppliers (Column A,
'Newworksheet'), with the products they supply (In Column B, 'Newworksheet')
- if multiple products, they can either be all in the same cell and
separated, or in subsequent columns (C, D, E etc.)
Logically I imagine it involves:
1. Using text-to-columns to initially split the supplier names out into
seperate cells
2. Identifying the unique records in the array
3. Copying this list to 'NewWorksheet'!Column A
4. Sequentially looking up each product by supplier from 'OldWorksheet' and
placing them in 'NewWorksheet'!Column B, C, D etc.
Any hints, I imagine it needs some logic applied as well as Excel & VBA.
Thanks