Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is a possible solution that I have started for you. What you are asking to be done gets rather complicated. Here is what I have so far: Option Explicit</p> <pre><code>Sub test() Dim items() As String Dim itemCount() As String Dim currCell As Range Dim currString As String Dim inArr As Boolean Dim arrLength As Integer Dim iterator As Integer Dim x As Integer Dim fullRange As Range Set fullRange = Range("E1:E15") iterator = 0 For Each cell In fullRange 'cycle through the range that has the values inArr = False For Each currString In items 'cycle through all values in array, if 'values is found in array, then inArr is set to true If currCell.Value = currString Then 'if the value in the cell we 'are currently checking is in the array, then set inArr to true inArr = True End If Next If inArr = False Then 'if we did not find the value in the array arrLength = arrLength + 1 ReDim Preserve items(arrLength) 'resize the array to fit the new values items(iterator) = currCell.Value 'add the value to the array iterator = iterator + 1 End If Next 'This where it gets tricky. Now that you have all unique values in the array, 'you will need to count how many times each value is in the range. 'You can either make another array to hold those values or you can 'put those counts on the sheet somewhere to store them and access them later. 'This is tough stuff! It is not easy what you need to be done. For x = 1 To UBound(items) Next End Sub </code></pre> <p>All that this does so far is get unique values into the array so that you can count how many times each one is in the range.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload