Hi everyone,

I am new to this forum and am already finding it pretty helpful. I am working trying to code a macro for the following. Any help will be appreciated.

Input .csv file has

SPlt SWell DPlt DWell Vol
S5 C1 D1 F11 10
S3 F12 D1 G02 10
S2 C4 D1 C07 10
S3 C4 D1 B08 10
S5 D4 D1 E05 10
S5 D8 D1 E07 10
S3 F12 D1 F12 10
S3 E3 D1 B05 10
S5 E2 D1 B12 10
S2 D8 D1 D09 10
S3 D4 D1 D04 10
S3 F12 D1 G06 10
S5 B1 D1 C08 10
S3 A11 D1 B03 10
S5 E11 D1 B10 10
S5 C3 D1 F08 10
S3 A12 D1 A08 10
S5 C5 D1 F06 10
S5 E10 D1 B11 10
S1 A1 D1 A02 10
S3 D1 D1 D08 10
S4 B7 D1 F03 10
S4 A5 D1 C05 10
S3 F12 D1 G03 10
S3 A5 D1 C04 10

First sort will have the rows sorted based on the first column. It will give result like this:
SPlt Swell DPlt Dwell Vol
S1 A1 D1 A02 10
S2 C4 D1 C07 10
S2 D8 D1 D09 10
S3 F12 D1 G02 10
S3 C4 D1 B08 10
S3 F12 D1 F12 10
S3 E3 D1 B05 10
S3 D4 D1 D04 10
S3 F12 D1 G06 10
S3 A11 D1 B03 10
S3 A12 D1 A08 10
S3 D1 D1 D08 10
S3 F12 D1 G03 10
S3 A5 D1 C04 10
S4 B7 D1 F03 10
S4 A5 D1 C05 10
S5 C1 D1 F11 10
S5 D4 D1 E05 10
S5 D8 D1 E07 10
S5 E2 D1 B12 10
S5 B1 D1 C08 10
S5 E11 D1 B10 10
S5 C3 D1 F08 10
S5 C5 D1 F06 10
S5 E10 D1 B11 10

After grouping each SPlt (source plate), Then sort rows again based on the second column.
I created a custom sort function for this (A1, B1, C1, D1, E1, F1, G1, H1, A2, B2 ... H12)

The result should look like this:

SPlt SWell DPlt DWell Vol
S1 A1 D1 A02 10
S2 C4 D1 C07 10
S2 D8 D1 D09 10
S3 D1 D1 D08 10
S3 E3 D1 B05 10
S3 C4 D1 B08 10
S3 D4 D1 D04 10
S3 A5 D1 C04 10
S3 A11 D1 B03 10
S3 A12 D1 A08 10
S3 F12 D1 G02 10
S3 F12 D1 F12 10
S3 F12 D1 G06 10
S3 F12 D1 G03 10
S4 A5 D1 C05 10
S4 B7 D1 F03 10
S5 B1 D1 C08 10
S5 C1 D1 F11 10
S5 E2 D1 B12 10
S5 C3 D1 F08 10
S5 D4 D1 E05 10
S5 C5 D1 F06 10
S5 D8 D1 E07 10
S5 E10 D1 B11 10
S5 E11 D1 B10 10

I tried could not get it to work given the complexity of implementing in the code. Please help!

Thanks,
Forum