Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chip Pearson's DistinctValues fctn, Run-time error '13': Type mismatch

Status
Not open for further replies.

alevol

MIS
Oct 22, 2010
8
GB
Hi All

I'm trying to use Chip Pearson's DistinctValues() function ( which should be pretty straightforward (following is just the relevant code):

Code:
Dim SdqAllIDsSSRSArray, SdqUniqueIDs, BigBoxArray() As Variant
Dim LastRowSdq As Integer

LastRowSdq = SSRS.Worksheets("sdq").Cells(Rows.Count, "A").End(xlUp).Row

SdqAllIDsSSRSArray = SSRS.Worksheets("sdq").Range(Cells(2, "A"), Cells(LastRowDiag, "A")).Value

SdqUniqueIDs = DistinctValues(InputValues:=SdqAllIDsSSRSArray, IgnoreCase:=True)

But I'm getting a "Run-time error '13': Type mismatch" further down when I try to ReDim BigBoxArray():

Code:
ReDim BigBoxArray(1 To UBound(SdqUniqueIDs, 1), 1 To 23)

I can't figure out why this is happening, since DistinctValues() returns an (variant) array. Any thoughts?

Many thanks,

Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top