提问人:Paw 提问时间:9/20/2023 最后编辑:JohnMPaw 更新时间:9/20/2023 访问量:24
将单元格列的格式设置为日期格式
Format column of cells to date format
问:
我想将 A 列中的所有单元格转换为日期格式“yyyy-mm-dd”,并在下面使用此代码
With ActiveSheet.UsedRange.Columns("A").Cells
.TextToColumns Destination:=.Cells(1), DataType:=xlFixedWidth, FieldInfo:=Array(0, xlYMDFormat)
.NumberFormat = "yyyy-mm-dd" 'change to any date-based number format you prefer the cells to display
End With
但并非所有单元格都已转换。
答: 暂无答案
评论
FieldInfo:=Array(0, xlDMYFormat)