【问题标题】:Incrementing time in excel macro在excel宏中增加时间
【发布时间】:2013-11-04 22:04:01
【问题描述】:

我需要一个 excel 宏来将时间增加半小时。我还将使用代码来修改其他单元格,但我无法让第一部分工作。单元格让 sat A1 采用时间格式,即下午 12:00:00。 我对此很陌生,所以我相信答案很简单。

提前致谢

【问题讨论】:

  • 到目前为止你有什么代码?你想要一个公式还是 VBA 模块?
  • 我正在寻找 VBA 模块
  • Private Sub Adjust_Pk_() Dim PkTime PkTime = Range("B53").Value Range("B53").Value = PV + Time(0.5, 0, 0) End Sub

标签: excel time increment vba


【解决方案1】:

将 A1 提前 30 分钟:

Sub Bump30Minutes()
    With Range("A1")
        .Value = .Value + TimeSerial(0, 30, 0)
    End With
End Sub

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-16
    • 1970-01-01
    • 2018-01-03
    • 1970-01-01
    • 2011-07-15
    • 2017-05-08
    • 2013-12-10
    相关资源
    最近更新 更多