Sub ConvertToDates() For Each cell In Selection If IsNumeric(cell.Value) Then cell.Value = DateSerial(Left(cell.Value, 4), Mid(cell.Value, 5, 2), Right(cell.Value, 2)) End If Next End Sub。这段代码适用于以YYYYMMDD形式存储的数值。运行此宏之前,先选中需要转换的所有单元格,执行宏之后所有符合条件的数字都会变成对应的日期。