For Each pi In pt.PivotFields("PAYOR ID").PivotItems x = Application.VLookup(CStr(pi.Value), ActiveSheet.Range("V3:V500"), 1, False) If CStr(pi.Value) = CStr(x) Then pi.Visible = True Else pi.Visible = False End If Next pi
I am having a type mismatch error on the above code set.
The range "V3:V500" and pi.value are both seperate pivots...which ultimately connect to same source data which is text.
Now the function would not work. The first value is (pi.value) '1010' and this value is not in the range.
So I put in a value 1010 below the pivot on column V, it would not pick it up. When I put '1010 (hence text) it would pick it up.
How do I go on to make excel believe that both pivots contains text? (or atleast make the column V text? - again, column V contains pivot table)
I am asking the range to be converted into text because I know that pi.value becomes text later on (such that there are other values such as BR001, etc)
PS: Application.match also does the same as it treats one pivot-table as text and other as number Temp.PNG
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.