Evalute Mismatch Type Problem

natekris8183

Board Regular
Joined
Mar 12, 2013
Messages
156
I have searched online and cannot find anything that addresses this. I know this is a syntax issues of carrying over the formula from the worksheet and appropriately converting certain special characters into the appropriately ASCII code. I placed the text in a messagebox to confirm it's correctness and it appears correct, so I am stumped.

This is the function in the worksheet I want to convert. The aim is to have listboxes populate with a fail safe to exit the loop once I find the last unique value. Just a time saver since there are over 1,000 product codes to cycle through with about 26 unique categories total:

Code:
=SUM(IF(FREQUENCY(IF(SKUListTbl[Category 1]=$L$12,MATCH($L$12&SKUListTbl[Category 2],SKUListTbl[Category 1]&SKUListTbl[Category 2],0),""),IF(SKUListTbl[Category 1]=$L$12,MATCH($L$12&SKUListTbl[Category 2],SKUListTbl[Category 1]&SKUListTbl[Category 2],0),""))>0,1))

This was my VBA language synonym to the above formula:
Code:
Evaluate("=SUM(IF(FREQUENCY(IF(SKUListTbl[Category 1]=" & Chr(34) & MainCategorySelection & Chr(34) & ",MATCH(" & Chr(34) & MainCategorySelection & Chr(34) & Chr(38) & "SKUListTbl[Category 2],SKUListTbl[Category 1]" & Chr(38) & "SKUListTbl[Category 2],0)," & Chr(34) & Chr(34) & "),IF(SKUListTbl[Category 1]=" & Chr(34) & MainCategorySelection & Chr(34) & ",MATCH(" & Chr(34) & MainCategorySelection & Chr(34) & Chr(38) & "SKUListTbl[Category 2],SKUListTbl[Category 1]" & Chr(38) & "SKUListTbl[Category 2],0)," & Chr(34) & Chr(34) & "))>0,1))")

$L$12 on the sheet will correspond to the variable set in the macro to a preceding listbox value. This is passing through find, as I said, since I see the variable string in the messagebox. Thanks in advance for any thoughts.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Your formula is too long - Evaluate is limited to strings of 255 characters or less.
 
Upvote 0
Ha, and the funny thing was, I placed it in the worksheet to count the characters. I forgot I have the maincategory unique values dividing into it, so it divided it by 2 and I thought I was ok. If I pass it to a string variable and evaluate the string, would that work in your opinion?
 
Upvote 0
No - the actual evaluated formula is restricted to that length regardless of whether you pass it directly or as a variable.
 
Upvote 0

Forum statistics

Threads
1,216,175
Messages
6,129,309
Members
449,499
Latest member
HockeyBoi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top