首页 > 解决方案 > 搜索功能无法找到公式结果

问题描述

我正在尝试执行搜索宏以在表格中查找特定日期。但是,表中的日期是通过从前一个日期加上 7 来设置的。因此,如果A1是,1/1/2018那么A2将是A1+7,导致1/8/2018,等等。我已经添加LookIn:=xlValues了搜索功能,但搜索仍然没有返回任何结果。非常感谢一些帮助。

这是我正在使用的代码:

target_date = Cells(2, 20).Value

Set finding = Cells.Find(What:=target_date, After:=Cells(1, 1), LookIn:=xlValues, LookAt:= _
    xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False _
    , SearchFormat:=False)

If Not finding Is Nothing Then finding.Activate

标签: vbaexcel

解决方案


推荐阅读