title: Create VBA macro to calculate unique value count with multitple criteria
body: <p>Below is an VBA function to calculate unique values count (Credit to <a href="https://stackoverflow.com/a/17857333/528859">SO: Count unique values in Excel</a>)
  is it possible to add criteria paramaters? Like in the function "countifs"?</p>
  
  <pre><code>   Public Function CountUnique(rng As Range) As Integer
      Dim dict As Dictionary
      Dim cell As Range
      Set dict = New Dictionary
      For Each cell In rng.Cells
           If Not dict.Exists(cell.Value) Then
              dict.Add cell.Value, 0
          End If
      Next
      CountUnique = dict.Count
  End Function
  </code></pre>