Excel VBA @SQL 字符串过滤器多个 LIKE 条件 [英] Excel VBA @SQL String filter Multiple LIKE Condition

查看:31
本文介绍了Excel VBA @SQL 字符串过滤器多个 LIKE 条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码按预期工作,但我还需要在主题行中排除 Autoreplies 和其他一些字符串.我需要知道是否可以再添加 2 或 3 个赞.

This code works as intended but I also need to exclude Autoreplies and some other strings in a subject line. I need to know if it's possible to add 2 or 3 more Likes.

我尝试了 And 和 Or 条件,但出现解析错误.

I tried And and Or conditions but I'm getting a parse error.

以下代码有效.我只需要在无法交付后添加另一个字符串条件."喜欢'%自动回复%'".

This code below works. I just need to add another string condition after undeliverable. " Like '%Automatic reply%'".

Filter = "@SQL=" & " Not " & _
             "urn:schemas:httpmail:subject" & "" & _
             " Like '%undeliverable%'"

谢谢.

推荐答案

OR 应该可以,下面的例子要么有%undeliverable%%自动回复%

Filter = "@SQL=" & " Not (urn:schemas:httpmail:subject" & _
                   " Like '%undeliverable%'  Or " & _
                         "urn:schemas:httpmail:subject" & _
                   " Like '%Automatic reply%')"

<小时>

再添加一个过滤器


To Add one more Filter

Filter = "@SQL=" & " Not (urn:schemas:httpmail:subject" & _
                   " Like '%undeliverable%'  Or " & _
                         "urn:schemas:httpmail:subject" & _
                   " Like '%Automatic reply%' Or " & _
                         "urn:schemas:httpmail:subject" & _
                   " Like '%Bla Bla%')"

这篇关于Excel VBA @SQL 字符串过滤器多个 LIKE 条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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