Unique sorting along rows

jumpulas

Board Regular
Joined
Sep 18, 2004
Messages
80
Hello all,
I have the following:
Data is columns A to F and I would like to unique sort each row and show the results in Cols I to M.
There are seveal rows of data and in this example I have only shown 2 rows.
Can any one help please.

Regards
Jumpulas
Excel Workbook
ABCDEFGHIJKLM
1Data1Data2Data3Data3Data4Data5Output1Output2Output3Output4Output5
2AlphaZetaZetaOmegaBetaAlphaAlphaBetaOmegaZeta
3TigerElephantLionLionTigerElephantLionTiger
Sheet13
Excel 2010
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Anyone to assist me!!!!

Thanks jumpulas


Hello all,
I have the following:
Data is columns A to F and I would like to unique sort each row and show the results in Cols I to M.
There are seveal rows of data and in this example I have only shown 2 rows.
Can any one help please.

Regards
Jumpulas
Excel Workbook
ABCDEFGHIJKLM
1Data1Data2Data3Data3Data4Data5Output1Output2Output3Output4Output5
2AlphaZetaZetaOmegaBetaAlphaAlphaBetaOmegaZeta
3TigerElephantLionLionTigerElephantLionTiger
Sheet13
Excel 2010
 
Upvote 0
Try this:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG25May17
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range, n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Rw [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] Ac [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A2"), Range("A" & rows.Count).End(xlUp))
ReDim Ray(1 To Rng.Count, 1 To 6)
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
Ac = 0
n = n + 1
[COLOR="Navy"]With[/COLOR] CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Rw [COLOR="Navy"]In[/COLOR] Dn.Resize(, 6)
        [COLOR="Navy"]If[/COLOR] Not .Exists(Rw.value) [COLOR="Navy"]Then[/COLOR]
            Ac = Ac + 1
            Ray(n, Ac) = Rw
            .Add Rw.value, ""
            [COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] Rw
[COLOR="Navy"]End[/COLOR] With
[COLOR="Navy"]Next[/COLOR] Dn
Range("i1").Resize(n, 6) = Ray
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,224,563
Messages
6,179,527
Members
452,923
Latest member
JackiG

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