Dim an array initially which will be filled with Product List numbers, and frequencies (2 dimensions)
As you read through the file, lookup the array to see if the Product List number is in there.
If it isn't in there, add a new element to the array - there will be one array element per product list, each element with two dimensions (product list number, and frequency)
Then, find the frequency code in the same way you are already doing.
Retrieve the product list array element from the array matching your product list number.
Check what the current frequency is - if there isn't one, then simply move in the calculated frequency.
If there is one, then use program logic to adjust what is in there already with the new frequency information.
At the end of the loop, you should have an array - taking your example two lines :
aProdList[1,1] = 3
aProdList[1,2] = "E2W"
aProdList[2,1] = 1
aProdList[2,2] = "E4W"
This can also be presented as :
aProdList[1] = [3,"E2W"]
aProdList[2] = [1,"E4W"]
The code will first encounter Product List 3 with it's A frequency, so a new array element will be added as follows :
ElementNumber = ElementNumber + 1
aProdList[ElementNumber,1] = 3
aProdList[ElementNumber,2] = "E4W"
Then, the code will read the second line.
It will again encounter Product List 3 - and find an array element already present for Product List 3 - which already has "E4W" in the second element.
It will therefore change this to "E2W".
The code will also encounter Product List 1 - and not find an array element already for it, so will add one :
ElementNumber = ElementNumber + 1
aProdList[ElementNumber,1] = 3
aProdList[ElementNumber,2] = "E4W"
I hope this makes sense - feel free to drop me an e-mail if not.