我有以下代码。但是,我在单元格中发现输出(即 SEP08)在单元格中转换为 Sep-08。我怎样才能在没有日期格式的 Excel 电子表格中显示 SEP08?
Dim StartMonth As String
Select Case Month(EarliestDate)
Case "1"
StartMonth = "JAN" & Right(Year(EarliestDate), 2)
Case "2"
StartMonth = "FEB" & Right(Year(EarliestDate), 2)
Case "3"
StartMonth = "MAR" & Right(Year(EarliestDate), 2)
Case "4"
StartMonth = "APR" & Right(Year(EarliestDate), 2)
Case "5"
StartMonth = "MAY" & Right(Year(EarliestDate), 2)
Case "6"
StartMonth = "JUN" & Right(Year(EarliestDate), 2)
Case "7"
StartMonth = "JUL" & Right(Year(EarliestDate), 2)
Case "8"
StartMonth = "AUG" & Right(Year(EarliestDate), 2)
Case "9"
StartMonth = "SEP" & Right(Year(EarliestDate), 2)
Case "10"
StartMonth = "OCT" & Right(Year(EarliestDate), 2)
Case "11"
StartMonth = "NOV" & Right(Year(EarliestDate), 2)
Case "12"
StartMonth = "DEC" & Right(Year(EarliestDate), 2)
End Select
ActiveCell.FormulaR1C1 = StartMonth