VBA过滤精确匹配 [英] VBA to Filter for exact match

查看:236
本文介绍了VBA过滤精确匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些代码的帮助。我正在使用此代码来过滤表单中的目录号([SEitem#])。我希望它能过滤完全匹配。当它立即过滤时,如果你放一个1,在[filtercat]文本框中,它会过滤以1开头的所有内容,如何更改代码以过滤完全匹配?

I need help with some code. I am using this code to filter for a catalog number([SEitem#]) in a form. I would like it to filter for the exact match. When it filters right now if you put a "1" in the [filtercat] text box it filters for everything that starts with "1", how do I change the code to filter for the exact match?

展开 | 选择 | Wrap | 行号

推荐答案

它返回以1开头的所有内容的原因是因为第8行中的 like 和 * QUOT;在第9行。所以SEitem#中的1就像1,10,100,155等。你希望它等于我!filtercat。我认为对于第7行到第9行的解决方法如下。

The reason that it is returning everything that starts with a 1 is because of the word like in line 8 and the "*" in line 9. So a 1 in SEitem# is like 1, 10, 100, 155, etc. You want it to equal Me!filtercat. I believe that the fix would be the following for lines 7 through 9.

展开 | 选择 | Wrap < span class =codeDivider> | 行号


第6行到第代码中的#9应该是:
Lines #6 to #9 in your code should be :
展开 | 选择 | Wrap < span class =codeDivider> | 行号


NeoPa,


感谢您的帮助。我把代码放在你给我的代码中,我现在在第15行& #16我的代码。有什么想法吗?


谢谢!

Lori
NeoPa,

Thank you for your help. I put the code in that you gave me and I am now getting an error on Line #15 & #16 of my code. Any thoughts?

Thanks!
Lori


这篇关于VBA过滤精确匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆