且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Excel VBA - 将单元格中的日期与当前日期进行比较

更新时间:2022-01-03 22:17:24

感谢 Dave 和 MiVoth 我做到了:

Thanks to Dave and MiVoth I did :

Dim xdate As Date  
xdate = Worksheets("sheet1").Range("A1")  
   If Month(Date) = Month(xdate) And Year(Date) = Year(xdate) Then  
      MsgBox "OK"  
   Else  
      MsgBox "not OK"  
   End If  

这样就完成了!
非常感谢大家,
加迪

That did the job!
Thank a lot to everyone,
Gadi