1、强制转日期格式,yyyy-m-d

Sheet2.Cells(2, 1) = Format(Sheet2.Cells(2, 1), "yyyy-m-d")
Sheet2.Cells(2, 25) = Format(Sheet2.Cells(2, 25), "yyyy-m-d")

2、取日期格式中的年 、月。

Sheet2.Cells(2, 3) = Month(Sheet2.Cells(2, 1))
Sheet2.Cells(2, 2) = Year(Sheet2.Cells(2, 1))

 

posted on 2018-12-16 18:40  飞鸟2018  阅读(3172)  评论(0编辑  收藏  举报