Outlook 中的日期格式问题,而 Excel-Outlook 自动化
我已使用宏将电子邮件导出到 Excel。通过使用 Mid
函数,我在电子邮件中找到了日期,但它的格式不是日期。
例如 2012 年 1 月 12 日星期四上午 8:30
此日期是文本,而不是格式化日期。如何将其格式化为日期?
I have exported email mesages to excel by using a macro. By using Mid
function I have found the date in the email, but it's not formated as a date.
For example Thursday, January 12, 2012 8:30 AM
This date is text, not a formated date. How do I format that as a date?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要先删除“星期四”。然后使用
CDate
。这应该有效You'll need to take out "Thursday, " bit first. And then use
CDate
. This Should Work尝试:
Try:
如果您需要公式解决方案:
假设单元格 A1 中包含以下内容:
Thursday, January 12, 2012 8:30 AM
以下公式将提取日期部分并对其进行格式化作为日期:
=DATEVALUE(MID(A1,FIND(",",A1)+1,LEN(A1)))
这将显示单元格中的
40920
。将单元格格式设置为日期,将其显示为 mm/dd/yyyy 日期(或者您想要的格式)。If you wanted a formula solution:
Assume the following is in cell A1:
Thursday, January 12, 2012 8:30 AM
The following formula will extract the date portion and format it as a date:
=DATEVALUE(MID(A1,FIND(",",A1)+1,LEN(A1)))
This will show
40920
in the cell. Format the cell as Date to display it as a mm/dd/yyyy date (or however you want to format it).