Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

Help please want to write string sorting function

$
0
0
Hi,

I am new to Visual basic but I have some java experience. I have a single column of data as text strings in an excel doc and I would like to use some code to sort that list and output two columns. the first with unique strings and the second with the frequency of that string in the original list.

here is an example of what i want the code to do

List:
Fruits

apple
apple
apple
melon
orange
apple
grape
orange
apple
melon
grape

output:

Fruit Frequency
apple 5
orange 2
grape 2
melon 2

I have been researching this for the past few days but I can't seem to figure out if it is possible to sort this way in VBA. I know there is a way to do it in java with arrays or array lists. Any help would be much appreciated.

Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>