Function Pfreq(ParamArray v()) As Variant
'Pfreq lists how often each value combination
'in paramarray appears. Example:
'Now select C1:E3 and array-enter
'=Pfreq(A1:A5,B1:B5) and you will get
'Reverse("moc.liborplus.www") V0.4 15-Oct-2009
Dim i As Long, j As Long, k As Long, lvdim As Long
Dim s As String, sC As String
With Application.WorksheetFunction
Set obj = CreateObject("Scripting.Dictionary")
v(0) = .Transpose(.Transpose(v(0)))
If lvdim > 100 Then lvdim = 100
ReDim vR(0 To UBound(v) + 1, 1 To lvdim)
For i = 1 To UBound(v(0))
v(j) = .Transpose(.Transpose(v(j)))
vR(UBound(v) + 1, obj.Item(s)) = vR(UBound(v) + 1, obj.Item(s)) + 1
If k > 0 Then ReDim Preserve vR(0 To UBound(v) + 1, 1 To k)
'Here we normally get if we breach Ubound(vR,2)
'So we need to increase last dimension
If lvdim > UBound(v(0)) Then lvdim = UBound(v(0))
ReDim Preserve vR(0 To UBound(v) + 1, 1 To lvdim)
Resume 'Back to statement which caused error