VBA过滤日期和名称字段 [英] VBA to filter dates and name field

查看:70
本文介绍了VBA过滤日期和名称字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格,我希望在员工的日期范围内过滤...例如,我希望在2/1/18 - 2/18/18之间所有记录,其中员工字段是Joe Smith ;


我设法让每个过滤器单独工作但不能一起工作。


这里是我的代码:

i have a form where i would like to filter within a date range by employee... for example i would want between 2/1/18 - 2/18/18 all records where the employee field is "Joe Smith"

I have managed to get each filter to work separately but not together.

here are my codes:

展开 | 选择 | Wrap | 行号

推荐答案

您应该能够简单地结合两组标准:

You should be able to simply combine the two sets of criteria:

展开 | 选择 | Wrap | 行号


这么简单,但却又如此困难......谢谢!!!
So simple, but yet so difficult... thank you!!!


抱歉,还有一件事......有没有办法将if语句结合起来?现在,如果在任何字段中没有输入任何内容,则会出现调试错误...我宁愿使用消息框吗?
sorry but one more thing... is there a way to combine it keeping the if statement? right now if nothing is entered in any of the fields it gives a debug error... i would rather a message box?


这篇关于VBA过滤日期和名称字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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