I would like to be able to get the counts of distinct value from my MSHFlexgrid2 in column 4.
ex:
In column 4, i can see values like: 20120101
20110605
20101212
20121019
I would like to have the look at the frist 4 chars from that value and then counts the number of time it shows.
Example of the msgbox: 2010 = 1 Records
2011 = 1 Records
2012 = 2 Records
How can i do that please?
Thanks again for your help
Visual Basic Classic
Last Comment
Wilder1626
8/22/2022 - Mon
Wilder1626
ASKER
I did this for now but this only give me the count of different text
Dim MyCollection As New CollectionDim k As IntegerFor k = 1 To MSHFlexGrid2.Rows - 1 If MSHFlexGrid2.TextMatrix(k, 4) <> "" Then On Error Resume Next MyCollection.Add MSHFlexGrid2.TextMatrix(k, 4), MSHFlexGrid2.TextMatrix(k, 4) On Error GoTo 0 End If Next k MsgBox MyCollection.Count
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Open in new window