Collections Collections Collections

So I've created a collected based off the selected items   and I have it showing only unique values which displays the collection  in a MsgBox.  How do I get it to count how many of each item it counted and displayed that next to it in the MsgBox.

For Each itm In colCol1

Txt = Txt  & itm & vbNewLine
Next itm

msgBox Txt

Example:

20 Hats

15 Shirts

5 Scarves

Parents
No Data
Reply
  • I tried a method like this one time and failed....so I decided to assign each count to a textbox on a form.

    Dim sr As ShapeRange

     

    Private Sub cmdCount_Click()

    Set sr = ActiveSelectionRange

    txtboxHats = sr.Count

    txtboxShirts = sr.Count

    txtboxScarves = sr.Count

    End Sub

     

    'Maybe something like this could work for you?

Children