2010 VBA - Ordered by Collection or Scripting.Dictionary

Herverob

New Member
Joined
Feb 4, 2013
Messages
3
Hi ,
My problem is not easy to describe but I will try to be as simple as possible.
I import a csv file into Excel but the csv is not filtered.
Depending on a value in Column B, I would like to re-order the column D to AL.
In the attached file, for example, for all value in column B = 113, I would like to order the following groups:
D to H, filter is ‘Tag’
I to M, filter is ‘Type’
N to R filter is ‘Stock Code’
S to W filter ‘STD’

for all value in column B = 228, I would like to order the following groups:
D to H, filter is ‘Tag’
I to M, filter is ‘Type’
N to R filter is ‘Stock Code’
S to W filter is ‘STD’
X to AB filter is ‘Emergency’
AC to AG filter is ‘Panel’
AH to AL filter is ‘CKT’

Instead of making a long and painfull speech, the result I would like is in cells A28 a AL51.

I have been told to use a ‘Collection’ or ‘scripting.dictionary’; the process will be fast to execute the macro but I am not familiar with these.
NB, In the original file, there are much more values in column B to ber e-ordere.
Thank you
Herve
 
I do not know how to attach an excel file so here is a snapshot
 
Upvote 0
Hello Herverob,

Your image did not attach. You may want to upload your file to a public file hosting service like DropBox, MediaFire, RapidShare, etc. You would then need to post the link back to file in your post.

If you have confidentiality concerns about posting your workbook publicly, you could send me a copy of the workbook via email. I have a standard confidentiality agreement that I use to ensure your workbook's privacy and protection. Any code developed as a solution would then be posted back here for others benefit.
 
Upvote 0

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