June 13th, 2015, 4:37 pm
Hi,I am attempting to count the number of unique string variables in a list (for example, let's say NFL team names). I found this formula that works just fine in excel...=SUMPRODUCT((A2:A100 <> "")/COUNTIF(A2:A100,A2:A100 & ""))I am now attempting to put this logic into vba via...=APPLICATION.WORKSHEETFUNCTION.SUMPRODUCT((A2:A100 <> "")/APPLICATION.WORKSHEETFUNCTION.COUNTIF(A2:A100,A2:A100 & "")). I get the following error message...Compile error: Type Mismatch and the <> is highlighted.I think I must be dimensioning the variables (the list of team names is the most likely candidate) incorrectly, but I have tried string, variant, and several others and I can't get rid of the error message.I'm sure I'm doing something stupid. Can someone help me out?Thanks,Beachcomber