以下代码显示Range(“ b2”)等于#8/28/2018#,并且第一个vlookup成功运行,但是第二个vlookup返回错误。
谁能解释为什么会这样?谢谢。
Sub vlup()
Dim idx As Double
Dim dt As Date
If Range("b2") = #8/28/2018# Then
MsgBox "They are equal. "
End If
dt = WorksheetFunction.VLookup(Range("b2"), Range("b1:b11"), 1, False)
MsgBox "The 1st search is valid. "
dt = WorksheetFunction.VLookup(#8/28/2018#, Range("b1:b11"), 1, False)
MsgBox "The 2nd search is valid. "
End Sub