1、首先在开发工具中打开VBA编辑器

2、在单元格区域当中输入一些内容作为例子

3、在VBA编辑器中插入模块

4、在模块当中输入如下代码,然后运行Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next If Target.Column = 1 And Target.Count = 1 Then Target = Application.WorksheetFunction.Text(Target.Text, "yyyy""年""m""月""d""日"" [$-804]aaaa") End IfEnd Sub

5、在A列输入“6-15”格式之数据,单元格将返回“2007年6月15日 星期五”,而在其他列输入则忽略
