【发布时间】:2012-03-14 15:13:07
【问题描述】:
我正在尝试通过在 Sheets("Sheet1").Cells(17, 3).Value 中的日期添加一个月来输入日期值,该日期为 01/10/2011,但格式为 Oct-11。然后在 Sheets("Sheet1").Cells(17, 4).Value = LDate 中返回,显示 Nov-11
sDate = Sheets("Sheet1").Cells(17, 3).Value --> this shows 01/10/2011 when I hove over sDate
LDate = DateAdd("m", 1, sDate) --> this shows 01/11/2011 when I hove over LDate
然后我想将该值 01/11/2011 输入到以下单元格中
Sheets("Sheet1").Cells(17, 4).Value = LDate
Selection.NumberFormat = "mmm-yy"
但在单元格中显示 11/01/2011(1 月 11 日),为什么会这样,我该如何解决这个问题?
【问题讨论】: