Range.Find not making a difference between January and November (February and December) in VBA Excel

后端 未结 3 699
忘了有多久
忘了有多久 2020-11-29 12:26

Let\'s say that I have the following trivial task:

  • Write the first date of the months from January 2016 to June 2018 on a row
  • Find 01-January-2016 and
3条回答
  •  渐次进展
    2020-11-29 13:15

    Not sure why it is finding 1 November, but you can fix it by specifying a value for the optional LookAt argument of the Find() method:

    Set foundRange = Rows(1).Find(CDate("01.01.2016"), Lookat:=xlWhole)
    

提交回复
热议问题