Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个复制一列的宏,其中 02/04/2013 12:35 表示 4 月 2 日,然后我将其粘贴并使用文本到列以摆脱时间部分。Excel 出于某种原因,而不是将其解释为 2 月 4 日。尝试在文本的最后一步选择文本到列和日期,但在这两种情况下它都会被翻转。
无法翻转的日期(例如 28/03/2013)仍然正确。
如果我不使用宏而是手动执行它,Excel 只有在将其作为发生的宏运行时才会翻转日期和月份。请注意,当仅将带有日期的单元格复制到带有日期的另一个单元格时,它也会出现在另一个宏中。
你可以试试:
Sub Convert_Dates() Dim Rng As Range Set Rng = Selection For Each c In Rng c.Value = DateSerial(Right(Split(c)(0), 4), Mid(Split(c)(0), 4, 2), Left(Split(c)(0), 2)) Next c End Sub
它还可以帮助“文本日期”使用格式和“dd/mmm/yyyy”,因为这不会混淆。