Count all values of each row from smaller to larger

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,353
Office Version
  1. 2010
Hello,</SPAN>

I want to count from smaller to larger valve of each row and put them in one cell separated by vertical bar. Is it possible?</SPAN></SPAN>

As per example below</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQRS
1
2
3
4
5n1n2n3n4n5n6n7n8n9n10n11n12n13n14Count Smaller to Larger
6
7100010101100106 | 8
8211021002011006 | 5 | 3
9300030103100108 | 3 | 3
10400140200210008 | 2 | 2 | 2
11010200300321008 | 2 | 2 | 2
12121311001000016 | 6 | 1 | 1
13200400010010109 | 3 | 1
14011501000100208 | 4 | 1 | 1
15000612101201315 | 5 | 2 | 1 | 1
160201101000000010 | 3 | 1
17101020201111105 | 7 | 2
182000010000000111 | 2
19000060150260137 | 2 | 1 | 1 | 1 | 2
20111070260301205 | 4 | 2 | 1 | 1 | 1
210020000100400011 | 1 | 1 | 1
220010000000021011 | 2 | 1
23012111011110204 | 8 | 2 |
24123222000201006 | 2 | 5 | 1
25034033101000116 | 4 | 3 | 1
26105040210100207 | 3 | 2 | 1 | 1
27210001321011006 | 5 | 2 | 1
28001110402022106 | 4 | 3 | 1
Sheet1


Thank you all</SPAN></SPAN>

Excel 2000</SPAN></SPAN>
Regards,</SPAN>
Moti</SPAN>
</SPAN></SPAN>
 
Last edited:
It may have something to do with Net Framework & mscorlib.tlb.
Maybe it needs update or the file is somehow missing.
Check this link:
http://www.snb-vba.eu/VBA_Sortedlist_en.html
then read this part:
3. The origin of the SortedList

So basically you need to locate 'mscorlib.tlb' then set the vbe reference to it.
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Can you run this without error?

Code:
Sub tryX()
Dim dar As Object
Set dar = CreateObject("System.Collections.ArrayList")
End Sub

and this:

Code:
Sub tryY()
Dim dar As Object
Set dar = CreateObject("System.Collections.Sortedlist")
End Sub
 
Last edited:
Upvote 0
This UDF seems to do the trick.

Code:
Function StL(r As Range)
Dim AR() As Variant: AR = r.Value
Dim SL As Object: Set SL = CreateObject("System.Collections.SortedList")
Dim res As String

For i = LBound(AR) To UBound(AR, 2)
    If Not SL.contains(AR(1, i)) Then
        SL.Add AR(1, i), 1
    Else
        SL.Item(AR(1, i)) = SL.Item(AR(1, i)) + 1
    End If
Next i

For j = 0 To SL.Count - 1
    res = res & SL.getbyindex(j) & "|"
Next j

StL = Left(res, Len(res) - 1)
End Function
 
Upvote 0
Not Sure if you have Power Query available, but this works as well.

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table5"]}[Content],
    Blanks = Table.SelectRows(Source, each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null}))),
    Combo = Table.AddColumn(Blanks, "Combo", each Text.Combine(List.Transform(Table.Column(Table.Group(
Table.Group(Table.FromList(List.Transform(List.Sort(Record.FieldValues(_)),Number.From), Splitter.SplitByNothing(), null, null, ExtraValues.Error), {"Column1"}, {{"Count", each Table.RowCount(_), type number}}), {"Column1"}, {{"Count.1", each List.Sum([Count]), type number}}),"Count.1"),Text.From),"|"))
in
    Combo

<table valign="top"><caption>LEGO HTML</caption><col width="54"><col width="124"><col width="124"><col width="124"><col width="104"><col width="104"><col width="104"><col width="104"><col width="104"><col width="104"><col width="104"><col width="104"><col width="104"><col width="110"><col width="110"><col width="110">
<tr><td></td><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">D</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">E</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">F</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">G</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">H</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">I</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">J</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">K</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">L</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">M</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">N</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">O</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">P</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">Q</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">R</font></th></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">1</font></th><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n1</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n2</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n3</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n4</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n5</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n6</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n7</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n8</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n9</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n10</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n11</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n12</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n13</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">n14</font></td><td style="background-color:rgb(112, 173, 71)"><font style="color:rgb(255, 255, 255)">Combo</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">2</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">8|6</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">3</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">6|5|3</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">4</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">8|3|3</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">5</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">8|2|2|2</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">6</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">8|2|2|2</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">7</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">6|6|1|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">8</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">9|3|1|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">9</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">5</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">8|4|1|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">10</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">6</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">5|5|2|1|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">11</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">10|3|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">12</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">5|7|2</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">13</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">11|2|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">14</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">6</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">5</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">6</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">7|2|1|1|1|2</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">15</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">7</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">6</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">5|4|2|1|1|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">16</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">11|1|1|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">17</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">11|2|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">18</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">4|8|2</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">19</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">6|2|5|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">20</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">6|4|3|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">21</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">5</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">7|3|2|1|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">22</font></th><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(226, 239, 218)"><font style="color:rgb(0, 0, 0)">6|5|2|1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">23</font></th><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">4</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">1</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">0</font></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">6|4|3|1</font></td></tr></table>
 
Upvote 0
Updated M code. Had an extra Table.Group function in the first one.

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table5"]}[Content],
    Blanks = Table.SelectRows(Source, each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null}))),
    Combo = Table.AddColumn(Blanks, "Custom", each Text.Combine(List.Transform(Table.Column(Table.Group(Table.FromList(List.Transform(List.Sort(Record.FieldValues(_)),Number.From),Splitter.SplitByNothing(), null, null, ExtraValues.Error), {"Column1"}, {{"Count", each Table.RowCount(_), type number}}),"Count"),Text.From),"|"))
in
    Combo[/SIZE]
 
Upvote 0
It may have something to do with Net Framework & mscorlib.tlb.
Maybe it needs update or the file is somehow missing.
Check this link:
http://www.snb-vba.eu/VBA_Sortedlist_en.html
then read this part:
3. The origin of the SortedList

So basically you need to locate 'mscorlib.tlb' then set the vbe reference to it.
Hello Akuini, I could locate In the VBEditor mscorlib.dll in the References (Tools/references...) and checked it. And saw the access coming from... "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscorlib.tlb" </SPAN></SPAN>

But it did not worked stop at the same line with same massage. I thought it might take effect after the restarting computer but problem continue. Strange it were working fine till last month, so I tried Restoring back to an earlier date but no results...</SPAN></SPAN>

Thank you for your help I will continue searching if got it work will let you know</SPAN></SPAN>

Kind Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>
 
Upvote 0
Can you run this without error?

Code:
Sub tryX()
Dim dar As Object
Set dar = CreateObject("System.Collections.ArrayList")
End Sub

and this:

Code:
Sub tryY()
Dim dar As Object
Set dar = CreateObject("System.Collections.Sortedlist")
End Sub
Hello Akuini, no both stop at the line below </SPAN></SPAN>
Code:
 Set dar = CreateObject("System.Collections.ArrayList")
</SPAN></SPAN>
And giving an error Run- time error'-2146232576 (80131700)': Automation error
</SPAN></SPAN>

Thank you
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Moti
</SPAN></SPAN>
 
Upvote 0
This UDF seems to do the trick.

Code:
Function StL(r As Range)
Dim AR() As Variant: AR = r.Value
Dim SL As Object: Set SL = CreateObject("System.Collections.SortedList")
Dim res As String

For i = LBound(AR) To UBound(AR, 2)
    If Not SL.contains(AR(1, i)) Then
        SL.Add AR(1, i), 1
    Else
        SL.Item(AR(1, i)) = SL.Item(AR(1, i)) + 1
    End If
Next i

For j = 0 To SL.Count - 1
    res = res & SL.getbyindex(j) & "|"
Next j

StL = Left(res, Len(res) - 1)
End Function
Hello lrobbo314, using the function in the cells S7=StL(D7:Q7) getting error #¡VALUE! Like this</SPAN></SPAN>

Please can you check it?
</SPAN></SPAN>

Thank you for your help
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Moti
</SPAN></SPAN>


Book1
DEFGHIJKLMNOPQRS
5n1n2n3n4n5n6n7n8n9n10n11n12n13n14Count Smaller to Larger
6
710001010110010#VALUE!
Sheet1
 
Last edited:
Upvote 0
Not Sure if you have Power Query available, but this works as well.

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table5"]}[Content],
    Blanks = Table.SelectRows(Source, each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null}))),
    Combo = Table.AddColumn(Blanks, "Combo", each Text.Combine(List.Transform(Table.Column(Table.Group(
Table.Group(Table.FromList(List.Transform(List.Sort(Record.FieldValues(_)),Number.From), Splitter.SplitByNothing(), null, null, ExtraValues.Error), {"Column1"}, {{"Count", each Table.RowCount(_), type number}}), {"Column1"}, {{"Count.1", each List.Sum([Count]), type number}}),"Count.1"),Text.From),"|"))
in
    Combo
Hello lrobbo314, I don't know if I got Power Query available in excel 2000, because i have never used the Power Query. and don't know where to find it. </SPAN></SPAN>

Thank you for your help and for new suggestions
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Moti
</SPAN></SPAN>
 
Upvote 0
Hello lrobbo314, using the function in the cells S7=StL(D7:Q7) getting error #¡VALUE! Like this

Please can you check it?


Thank you for your help


Kind Regards,

Moti


Yeah, I tested it again, it works and you seem to have done everything correctly. I actually posted this solution without seeing the issue you were having with dlls and the sortedlist object. I'm guessing that's the issue.

And it looks like you need at least Excel 2013 to install Power Query, so no go on that one either.

:eek:
 
Upvote 0

Forum statistics

Threads
1,213,535
Messages
6,114,192
Members
448,554
Latest member
Gleisner2

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