nnsea 发表于 2024-2-10 09:18:38

VBA 时间格式


Sub InsertDateTime()
    ' 在活动工作表的A1单元格插入当前日期和时间
    Range("A1").Value = Now
    ' 格式化单元格以显示日期和时间
    Range("A1").NumberFormat = "yyyy-mm-dd hh:mm:ss"
End Sub
页: [1]
查看完整版本: VBA 时间格式