Sub test()
Dim rng As Range
Dim irow, icol
irow = Cells(Rows.Count, 1).End(xlUp).Row
icol = Cells(1, Columns.Count).End(xlToLeft).Column
For Each rng In Range(Cells(1, 1), Cells(irow, icol))
If IsDate(rng) Then rng = Format(rng, "yyyymmdd")
Next
Range(Cells(1, 1), Cells(irow, icol)).NumberFormatLocal = "G/通用格式"
End Sub
Sub test()
Dim rng As Range
Dim irow, icol
irow = Cells(Rows.Count, 1).End(xlUp).Row
icol = Cells(1, Columns.Count).End(xlToLeft).Column
For Each rng In Range(Cells(1, 1), Cells(irow, icol))
If IsDate(rng) Then rng = Format(rng, "yyyymmdd")
Next
Range(Cells(1, 1), Cells(irow, icol)).NumberFormatLocal = "G/通用格式"
End Sub