excel表格中日期格式全部转换成yyyymm格式

excel表格中日期格式全部转换成yyyymm格式(201101),原始格式不统一,有2011.01,2011/01,2011-01-01,11.1。急求,在线等。补充下,用单位格格式里面的用不了

1、选中需要修改格式的单桥顷元格。大磨

2、数字项的分类中日期。

3、选择yyyymm

确定敏仿陆 ,选中单元格的日期 都城会改变了。


单位格式里改不型燃了的情况,应该是excel的一个小Bug,曾经令我头痛很久。我最后找出的解决橘档方法是这样的:
假设你的日期在A列。在B1输入"=a1+1-1"圆租乱,然后自动填充B列。然后将B列的格式调好,然后复制并条件粘贴值到B列本身,然后将B列复制粘贴到A列。
查找宴缓:.
替换为衫搜:-
全部替换。
设置单元格格或祥历式,自定义:yyyymm
假设改轿日期从A列第一行开始
Sub changedate()
Dim mystr As String
For i = 1 To Range("a65535").End(xlUp).Row
mystr = ""
n = 0
For j = 1 To Len(Cells(i, 1))
x = Mid(Cells(i, 1), j, 1)
If x Like "[0-9]" Then
mystr = mystr & x
Else
If n = 0 Then
mystr = mystr & "-"
n = 1
Else
Exit For
End If
End If
Next j
If InStr(mystr, "-") >尺山 0 Then
rstr = Right(mystr, Len(mystr) - InStr(mystr, "陵歼中-"))
If Len(rstr) = 1 Then
rstr = "0" & rstr
End If
If Len(Left(mystr, InStr(mystr, "-") - 1)) = 4 Then
Cells(i, 1) = Val(Left(mystr, InStr(mystr, "-") - 1)) & rstr
Else
Cells(i, 1) = 2000 + Val(Left(mystr, InStr(mystr, "-") - 1)) & rstr
End If
Else
Cells(i, 1) = mystr
End If
Next i
End Sub
YYYYMM要怎么填写隔式